Hi,
We have on-premise installation of ServiceBus and Java JMS QPID client 0.26. It seems that there is bug in SB - it sends END command (unauthorized-access) to idle consumer.
Here is my consumer:
session = connection.createSession(false,Session.CLIENT_ACKNOWLEDGE);Queue queue =(Queue) context.lookup("JBA_QUEUE");
consumer = session.createConsumer(queue);
connection.start();int consumed =0;while(true){long startMS =System.currentTimeMillis();Message message = consumer.receive(RECEIVE_TIMEOUT_MS);if(message !=null){
consumed++;
message.acknowledge();continue;}long durationMS =System.currentTimeMillis()- startMS;if(durationMS < RECEIVE_TIMEOUT_MS){
log.info(String.format("Connection is closed, timeout: %d[ms], waited: %s[ms] (consumed: %d)",
RECEIVE_TIMEOUT_MS, durationMS, consumed));break;}
log.info(String.format("Receive timeout, retrying (consumed: %d)", consumed));
consumed =0;}
I read messages out of empty queue, here is console output
11:08:02,407[ main] INFO [Qpid]Receive timeout, retrying (consumed:0)11:08:32,466[ main] INFO [Qpid]Receive timeout, retrying (consumed:0).....11:31:03,067[ main] INFO [Qpid]Receive timeout, retrying (consumed:0)11:31:33,068[ main] INFO [Qpid]Receive timeout, retrying (consumed:0)11:32:03,070[ main] INFO [Qpid]Receive timeout, retrying (consumed:0)11:32:32,841[ main] INFO [Qpid]Connection is closed, timeout:30000[ms], waited:29771[ms](consumed:0)
The receive() returned prior timeout elapsed because server closed the connection with unauthorized-access:
[11:07:32] FINE: SEND[:5671|0]:Open{containerId=XXXX(3628):1,hostname=XXXX,maxFrameSize=65536,channelMax=255}[11:07:32] FINE: RECV[:5671|0]:Open{containerId=087d0b7b8a8e4809a686f8b20d5376f5_GXXXX,maxFrameSize=65536,channelMax=255,idleTimeOut=240000}[11:07:32] FINE: SEND[:5671|0]:null[11:07:32] FINE: SEND[:5671|0]:Begin{nextOutgoingId=0,incomingWindow=2048,outgoingWindow=2048,handleMax=4294967295}[11:07:32] FINE: SEND[:5671|0]:Attach{name=IntegrationServiceBus/jba_testing_queue->(5bb07059-3e84-42fb-b11d-9d1be5d8bdf0),handle=0,role=receiver,sndSettleMode=unsettled,rcvSettleMode=first,source=Source{address=IntegrationServiceBus/jba_testing_queue,durable=none,expiryPolicy=link-detach},target=Target{}}[11:07:32] FINE: RECV[:5671|0]:Begin{remoteChannel=0,nextOutgoingId=1,incomingWindow=2048,outgoingWindow=2048,handleMax=7}[11:07:32] FINE: RECV[:5671|0]:Attach{name=IntegrationServiceBus/jba_testing_queue->(5bb07059-3e84-42fb-b11d-9d1be5d8bdf0),handle=0,role=sender,sndSettleMode=unsettled,rcvSettleMode=first,source=Source{address=IntegrationServiceBus/jba_testing_queue,durable=none,expiryPolicy=link-detach},target=Target{},initialDeliveryCount=0,maxMessageSize=262144,properties={com.microsoft:tracking-id=087d0b7b8a8e4809a686f8b20d5376f5_GPXXXX_BXXXXX;2443:66:67}}[11:07:32] FINE: SEND[:5671|0]:Flow{nextIncomingId=1,incomingWindow=2048,nextOutgoingId=0,outgoingWindow=2048,handle=0,deliveryCount=0,linkCredit=100,drain=false,echo=false}[11:09:32] FINE: SEND[:5671|0]:null[11:11:32] FINE: SEND[:5671|0]:null[11:13:32] FINE: SEND[:5671|0]:null[11:15:32] FINE: SEND[:5671|0]:null[11:17:32] FINE: SEND[:5671|0]:null[11:19:32] FINE: SEND[:5671|0]:null[11:21:33] FINE: SEND[:5671|0]:null[11:23:33] FINE: SEND[:5671|0]:null[11:25:33] FINE: SEND[:5671|0]:null[11:27:33] FINE: SEND[:5671|0]:null[11:29:33] FINE: SEND[:5671|0]:null[11:31:33] FINE: SEND[:5671|0]:null[11:32:32] FINE: RECV[:5671|0]:End{error=Error{condition=unauthorized-access}}[11:32:32] FINE: SEND[:5671|0]:Detach{handle=0}[11:32:32] FINE: SEND[:5671|0]:End{}[11:32:32] FINE: SEND[:5671|0]:End{}[11:32:32] FINE: SEND[:5671|0]:Close{}[11:32:32] FINE: RECV[:5671|0]:Close{}
Can anybody help us?
Thanks a lot,
George