RabbitMQ JMS server gets RESOURCE_LOCKED error on reply queue

284 views
Skip to first unread message

John Lilley

unread,
Sep 28, 2018, 10:44:40 AM9/28/18
to rabbitmq-users
I saw a similar post on this group with no resolution, and the poster did not supply an example.  I have attached a small example that produces the following error when the server attempts to send to the reply queue.  
This example was cribbed nearly verbatim from here: http://activemq.apache.org/how-should-i-implement-request-response-with-jms.html
Is this a bug in RabbitMQ's JMS implementation?  Surely there must be a workaround or fix, otherwise RabbitMQ JMS provider would be useless.

John Lilley

[pool-3-thread-1] ERROR com.rabbitmq.jms.client.RMQSession - RabbitMQ exception on queue declare name(jms-temp-queue-2b0489ea-3c9c-44e3-8ec9-120de6213541), durable(false), exclusive(true), auto-delete(false), properties(null)
java.io.IOException
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:124)
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:120)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:142)
at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:958)
at com.rabbitmq.client.impl.recovery.AutorecoveringChannel.queueDeclare(AutorecoveringChannel.java:333)
at com.rabbitmq.jms.client.RMQSession.declareRMQQueue(RMQSession.java:864)
at com.rabbitmq.jms.client.RMQSession.declareDestinationIfNecessary(RMQSession.java:630)
at com.rabbitmq.jms.client.RMQMessageProducer.sendJMSMessage(RMQMessageProducer.java:318)
at com.rabbitmq.jms.client.RMQMessageProducer.internalSend(RMQMessageProducer.java:283)
at com.rabbitmq.jms.client.RMQMessageProducer.access$300(RMQMessageProducer.java:32)
at com.rabbitmq.jms.client.RMQMessageProducer$PreferMessageProducerPropertySendingStategy.send(RMQMessageProducer.java:438)
at com.rabbitmq.jms.client.RMQMessageProducer.send(RMQMessageProducer.java:230)
at Server.onMessage(Server.java:86)
at com.rabbitmq.jms.client.DeliveryExecutor$CallOnMessage.call(DeliveryExecutor.java:33)
at com.rabbitmq.jms.client.DeliveryExecutor$CallOnMessage.call(DeliveryExecutor.java:23)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'jms-temp-queue-2b0489ea-3c9c-44e3-8ec9-120de6213541' in vhost '/', class-id=50, method-id=10)
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:443)
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:263)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:136)
... 16 more
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'jms-temp-queue-2b0489ea-3c9c-44e3-8ec9-120de6213541' in vhost '/', class-id=50, method-id=10)
at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:515)
at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:340)
at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:162)
at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:109)
at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:676)
at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:48)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:603)
... 1 more

Please see attached.  Just run the client and server.

I have installed the RabbitMQ topic selector plugin for JMS.  My rabbitmq status (on Windows 10) is:

$ rabbitmqctl.bat status
Status of node rabbit@rpb-desk-47 ...
[{pid,15780},
 {running_applications,
     [{rabbitmq_jms_topic_exchange,
          "RabbitMQ JMS topic selector exchange plugin","3.7.5"},
      {rabbit,"RabbitMQ","3.7.5"},
      {rabbit_common,
          "Modules shared by rabbitmq-server and rabbitmq-erlang-client",
          "3.7.5"},
      {ranch_proxy_protocol,"Ranch Proxy Protocol Transport","1.5.0"},
      {ranch,"Socket acceptor pool for TCP protocols.","1.5.0"},
      {ssl,"Erlang/OTP SSL application","8.2.4"},
      {public_key,"Public key infrastructure","1.5.2"},
      {asn1,"The Erlang ASN1 compiler version 5.0.5","5.0.5"},
      {xmerl,"XML parser","1.3.16"},
      {os_mon,"CPO  CXC 138 46","2.4.4"},
      {recon,"Diagnostic tools for production use","2.3.2"},
      {mnesia,"MNESIA  CXC 138 12","4.15.3"},
      {jsx,"a streaming, evented json parsing toolkit","2.8.2"},
      {inets,"INETS  CXC 138 49","6.5"},
      {crypto,"CRYPTO","4.2.1"},
      {lager,"Erlang logging framework","3.5.1"},
      {goldrush,"Erlang event stream processor","0.1.9"},
      {compiler,"ERTS  CXC 138 10","7.1.5"},
      {syntax_tools,"Syntax tools","2.1.4"},
      {sasl,"SASL  CXC 138 11","3.1.1"},
      {stdlib,"ERTS  CXC 138 10","3.4.4"},
      {kernel,"ERTS  CXC 138 10","5.4.3"}]},
 {os,{win32,nt}},
 {erlang_version,
     "Erlang/OTP 20 [erts-9.3] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:64]\n"},
 {memory,
     [{connection_readers,12104},
      {connection_writers,0},
      {connection_channels,0},
      {connection_other,29888},
      {queue_procs,51224},
      {queue_slave_procs,0},
      {plugins,11904},
      {other_proc,27715736},
      {metrics,188280},
      {mgmt_db,0},
      {mnesia,86400},
      {other_ets,1906608},
      {binary,864304},
      {msg_index,29808},
      {code,25031861},
      {atom,1041593},
      {other_system,11949586},
      {allocated_unused,14376960},
      {reserved_unallocated,1048576},
      {strategy,rss},
      {total,[{erlang,68919296},{rss,84344832},{allocated,83296256}]}]},
 {alarms,[]},
 {listeners,[{clustering,25672,"::"},{amqp,5672,"::"},{amqp,5672,"0.0.0.0"}]},
 {vm_memory_calculation_strategy,rss},
 {vm_memory_high_watermark,0.4},
 {vm_memory_limit,13722366771},
 {disk_free_limit,50000000},
 {disk_free,101701545984},
 {file_descriptors,
     [{total_limit,8092},
      {total_used,3},
      {sockets_limit,7280},
      {sockets_used,1}]},
 {processes,[{limit,1048576},{used,237}]},
 {run_queue,0},
 {uptime,66450},
 {kernel,{net_ticktime,60}}]

rabbitmq-jms-bug.zip

John Lilley

unread,
Sep 28, 2018, 11:01:20 AM9/28/18
to rabbitmq-users
FYI, this seems to be a known issue reported here:
The workaround is simple:
 
Destination replyQueue = message.getJMSReplyTo();
if (replyQueue instanceof RMQDestination) {
((RMQDestination)replyQueue).setDeclared(true);
}
replyProducer.send(replyQueue, response);

But... why has this not been fixed yet?

Luke Bakken

unread,
Sep 28, 2018, 11:32:18 AM9/28/18
to rabbitmq-users
Hi John,

As Michael explains here, the RabbitMQ core team is small and must juggle the priorities of the core product, client libraries, documentation and support for paying customers among other items.

What's great is that literally everything we work on is open source, and our team prioritizes reviewing pull requests from the community. Should a PR be opened to address this issue, we will review it. Until then, be satisfied with the work around and know that this issue is not going to be ignored.

Thanks,
Luke

John Lilley

unread,
Sep 29, 2018, 10:50:06 AM9/29/18
to rabbitmq-users
Thanks Luke and Michael,
I'll try to be more constructive.
I've forked jms-client repo with an intent to try a simple fix for #47 and see if it is an acceptable patch pending implementation #48.

I can build, but tests fail. I am on Windows, and at some point it invokes "make"
[ERROR] Failed to execute goal org.codehaus.gmaven:groovy-maven-plugin:2.0:execute (query-test-tls-certs-dir) on project rabbitmq-jms: Execution query-test-tls-certs-dir of goal org.codehaus.gmaven:groovy-maven-plugin:2.0:execute failed: java.io.IOException: Cannot run program "make": CreateProcess error=2, The system cannot find the file specified -> [Help 1]

I'd rather not switch to linux dev env; is there a way to make this succeed on Windows or should I ignore it for now?

john

Michael Klishin

unread,
Sep 29, 2018, 3:23:34 PM9/29/18
to rabbitm...@googlegroups.com
msys2 is likely the easiest way but it's not that different from switching to Linux.

Several RabbitMQ client test suite rely on a common build toolchain [1] for certificate generation, invoking CLI tools,
restarting or killing nodes and so on. We try to make it possible to develop without using it but `make` is a hard dependency.

If you push your branch to your GitHub fork I'd be happy to run the tests (not on Windows though).


--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
MK

Staff Software Engineer, Pivotal/RabbitMQ

John Lilley

unread,
Sep 30, 2018, 11:30:46 AM9/30/18
to rabbitmq-users
I've created a stopgap fix for #47 in my fork, which at least passes the "JMS 101 RPC" test, but may have side-effects.
--john

Michael Klishin

unread,
Sep 30, 2018, 6:38:47 PM9/30/18
to rabbitm...@googlegroups.com
Can you please submit a PR for the mainline repo?

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arnaud Cogoluègnes

unread,
Oct 2, 2018, 5:19:29 AM10/2/18
to rabbitm...@googlegroups.com
Thanks for providing a fix, but unfortunately it's not acceptable (no
tests, use of a static field). Nevertheless, we can come up with
something based on it, I'll follow up on [1].

[1] https://github.com/rabbitmq/rabbitmq-jms-client/issues/47
Reply all
Reply to author
Forward
0 new messages