The application fails to subscribe

There are several common reasons why an application might fail to subscribe to a topic.

Can the application connect?

If the application fails to connect to Eclipse Amlen, the application is unable to subscribe. For more information about troubleshooting application connection problems, see The application fails to connect.

Is the topic string valid?

If the topic string is not valid, the application is unable to subscribe to that topic. If the topic string is not valid, you might see errors in the logs. For example:
rc=136 clean=0 reason="The topic is not valid.
Unable to create a consumer because the destination is not valid:"
To resolve the problem, change the topic to a valid string. For more information about valid topic strings, see Topic Strings, and Wildcards.

Does the messaging policy allow the application to subscribe?

When you create a messaging policy, you can restrict whether an application can publish or subscribe to a topic string. The restriction can be based on one or more of the following values: IP address, client ID, messaging user ID, messaging group, or the client certificate used. If the application cannot subscribe, the cause might be that the messaging policy does not allow the application to subscribe.

Check the connection log for messages that indicate that the application is not authorized to subscribe. You can set the logging level of the security log to MAX to gather further security-related diagnostic information. For more information about changing the logging level, see Configuring log files.

To resolve the problem, change the messaging policy to allow the application to subscribe. Alternatively, connect the application to an endpoint with messaging policies that allow the application to subscribe.

Are the correct messaging policies specified?

When you create applications that use global-shared durable subscriptions, you must define two messaging policies on the endpoint:
  • A subscription messaging policy that defines which client applications can subscribe to the global-shared durable subscription.
  • A topic messaging policy that defines which client applications can access the topic that is associated with the subscription name defined in the subscription messaging policy.
If you do not define the two messaging policies, you might see error message CWLNC0207.

For more information about messaging policies, see Authorizing client messaging.