pkumar
pkumar

Reputation: 11

Azure Service bus Queue - Setup of JMS message listener invoker failed for destination exception

I'm able to connect and consume messages from Azure service bus queue. But following error is appearing randomly while message processing is in progress. After the error appears it looks like either the messages are not getting consumed further or they are pushed to DLQ. Restarting listener application is causing the same exception to appear.

I'm using Spring DefaultMessageListenerContainer with Apache Qpid

2016-05-05 01:49:36.303 WARN 14716 — [nerContainer-61] o.s.j.l.DefaultMessageListenerContainer : Setup of JMS message listener invoker failed for destination 'org.apache.qpid.amqp_1_0.jms.impl.QueueImpl@5f61cba7' - trying to recover. Cause: Timeout waiting for attach

Unknown endpoint Transfer{handle=0,deliveryId=36,deliveryTag=P\xb8)T\xd9\xea%A\x95\xe5Fj]\x91\x00\x15,messageFormat=0,more=false,batchable=true} Unknown endpoint Transfer{handle=0,deliveryId=36,deliveryTag=\xdc\x9b\x9d\xf5\x817\x9bO\x97.\x19\xeam<\x00\x81,messageFormat=0,more=false,batchable=true}

javax.jms.IllegalStateException: Closed at org.apache.qpid.amqp_1_0.jms.impl.SessionImpl.checkClosed(SessionImpl.java:326) at org.apache.qpid.amqp_1_0.jms.impl.SessionImpl.getTransacted(SessionImpl.java:222) at org.springframework.jms.listener.AbstractMessageListenerContainer.commitIfNecessary(AbstractMessageListenerContainer.java:757) at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:665) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:315) at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:253) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1158) at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1052) at java.lang.Thread.run(Unknown Source)

UPDATED:

`public DefaultMessageListenerContainer messageListenerContainer() throws NamingException {
    DefaultMessageListenerContainer messageListenerContainer = new DefaultMessageListenerContainer();
    messageListenerContainer.setConnectionFactory(connectionFactory());
    Destination queue = (Destination) context.lookup("STORAGE_NEW_QUEUE");
    messageListenerContainer.setDestination(queue);
    messageListenerContainer.setConcurrency(concurrency);
    messageListenerContainer.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);
    messageListenerContainer.setCacheLevel(DefaultMessageListenerContainer.CACHE_SESSION);
        messageListenerContainer.setErrorHandler(new EDIMessageErrorHandler());
    MessageListenerAdapter adapter = new MessageListenerAdapter();
    adapter.setDelegate(new EDIMessageListener());
    adapter.setDefaultListenerMethod("onMessage");
    messageListenerContainer.setMessageListener(adapter);
    return messageListenerContainer;
}`

Please advise on what could be the issue.

Thanks

Upvotes: 1

Views: 2211

Answers (1)

Peter Pan
Peter Pan

Reputation: 24148

I'm not sure what reason caused the issue without any codes.

However, there is an offical document Service Bus messaging exceptions that lists some exceptions generated by the Microsoft Azure Service Bus messaging APIs, and the section Exception types lists messaging exception types, and their causes, and notes suggested action you can take. I think you can refer to it for inspecting your issue.

According to the exception information Unknown endpoint, per my exception, I think the reason might be in the configuration for the AMQP connection with QPID. I searched for the possible reason, and got the helpful link https://mail-archives.apache.org/mod_mbox/qpid-users/201009.mbox/%[email protected]%3E. Hope it help.

Could you share the key codes for investaging the issue?

Any concern, please feel free to let me know.

Upvotes: 0

Related Questions