Dear Rabbitters,

We've got a situation -- it must be quite common -- where, in the simplest
case, we have two application nodes, call them A and B. RabbitMQ server is
running on the machines for both A and B. The B node has established it's
connection to exchange and queue, but does not know whether A has. In the
case that A has, all is well in the world. When B sends a message to A over
RabbitMQ, A happily processes it and returns a response message. However, if
A has not established it's connection to exchange and queue, then if B has
sent a message to A on this exchange and queue, then when A establishes it's
connection -- not only does it not see the pending message, the next message
B sends causes a Java exception to be thrown (see below). Now, we can
arrange a bit of a handshake to work around this, and have done so. However,
we'd like to know if there's a better or Rabbitier way of doing this.

Best wishes,

--greg

com.rabbitmq.client.AlreadyClosedException: clean connection shutdown;
reason: Attempt to use closed channelscala>
at com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:181)
at com.rabbitmq.client.impl.AMQChannel.transmit(AMQChannel.java:276)
at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:521)
at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:507)
at net.liftweb.amqp.AMQPSender.send(AMQPSender.scala:25)
at net.liftweb.amqp.AMQPSender$$anonfun$loop$1.apply(AMQPSender.scala:32)
at net.liftweb.amqp.AMQPSender$$anonfun$loop$1.apply(AMQPSender.scala:31)
at scala.actors.ReactorTask.run(ReactorTask.scala:31)
at scala.actors.Reactor$class.resumeReceiver(Reactor.scala:129)
at net.liftweb.amqp.AMQPSender.scala$actors$ReplyReactor$$super$resumeReceiver(AMQPSender.scala:15)
at scala.actors.ReplyReactor$class.resumeReceiver(ReplyReactor.scala:68)
at net.liftweb.amqp.AMQPSender.resumeReceiver(AMQPSender.scala:15)
at scala.actors.Actor$class.searchMailbox(Actor.scala:500)
at net.liftweb.amqp.AMQPSender.searchMailbox(AMQPSender.scala:15)
at scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(Reactor.scala:117)
at scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply(Reactor.scala:114)
at scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply(Reactor.scala:114)
at scala.actors.ReactorTask.run(ReactorTask.scala:33)
at scala.concurrent.forkjoin.ForkJoinPool$AdaptedRunnable.exec(ForkJoinPool.java:611)
at scala.concurrent.forkjoin.ForkJoinTask.quietlyExec(ForkJoinTask.java:422)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.mainLoop(ForkJoinWorkerThread.java:340)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:325)



--
L.G. Meredith
Managing Partner
Biosimilarity LLC
7329 39th Ave SW
Seattle, WA 98136

+1 206.650.3740

http://biosimilarity.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110705/3c753451/attachment.htm>

Search Discussions

  • Alexis Richardson at Jul 14, 2011 at 2:39 pm
    Greg

    Did you resolve this?

    alexis

    On Tue, Jul 5, 2011 at 6:10 PM, Meredith Gregory
    wrote:
    Dear Rabbitters,
    We've got a situation -- it must be quite common -- where, in the simplest
    case, we have two application nodes, call them A and B. RabbitMQ server is
    running on the machines for both A and B. The B node has established it's
    connection to exchange and queue, but does not know whether A has. In the
    case that A has, all is well in the world. When B sends a message to A over
    RabbitMQ, A happily processes it and returns a response message. However, if
    A has not established it's connection to exchange and queue, then if B has
    sent a message to A on this exchange and queue, then when A establishes it's
    connection -- not only does it not see the pending message, the next message
    B sends causes a Java exception to be thrown (see below).?Now, we can
    arrange a bit of a handshake to work around this, and have done so. However,
    we'd like to know if there's a better or Rabbitier way of doing this.
    Best wishes,
    --greg

    com.rabbitmq.client.AlreadyClosedException: clean connection shutdown;
    reason: Attempt to use closed channelscala>
    at
    com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:181)
    at com.rabbitmq.client.impl.AMQChannel.transmit(AMQChannel.java:276)
    at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:521)
    at com.rabbitmq.client.impl.ChannelN.basicPublish(ChannelN.java:507)
    at net.liftweb.amqp.AMQPSender.send(AMQPSender.scala:25)
    at
    net.liftweb.amqp.AMQPSender$$anonfun$loop$1.apply(AMQPSender.scala:32)
    at
    net.liftweb.amqp.AMQPSender$$anonfun$loop$1.apply(AMQPSender.scala:31)
    at scala.actors.ReactorTask.run(ReactorTask.scala:31)
    at scala.actors.Reactor$class.resumeReceiver(Reactor.scala:129)
    at
    net.liftweb.amqp.AMQPSender.scala$actors$ReplyReactor$$super$resumeReceiver(AMQPSender.scala:15)
    at
    scala.actors.ReplyReactor$class.resumeReceiver(ReplyReactor.scala:68)
    at net.liftweb.amqp.AMQPSender.resumeReceiver(AMQPSender.scala:15)
    at scala.actors.Actor$class.searchMailbox(Actor.scala:500)
    at net.liftweb.amqp.AMQPSender.searchMailbox(AMQPSender.scala:15)
    at
    scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(Reactor.scala:117)
    at
    scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply(Reactor.scala:114)
    at
    scala.actors.Reactor$$anonfun$startSearch$1$$anonfun$apply$mcV$sp$1.apply(Reactor.scala:114)
    at scala.actors.ReactorTask.run(ReactorTask.scala:33)
    at
    scala.concurrent.forkjoin.ForkJoinPool$AdaptedRunnable.exec(ForkJoinPool.java:611)
    at
    scala.concurrent.forkjoin.ForkJoinTask.quietlyExec(ForkJoinTask.java:422)
    at
    scala.concurrent.forkjoin.ForkJoinWorkerThread.mainLoop(ForkJoinWorkerThread.java:340)
    at
    scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:325)


    --
    L.G. Meredith
    Managing Partner
    Biosimilarity LLC
    7329 39th Ave SW
    Seattle, WA 98136

    +1 206.650.3740

    http://biosimilarity.blogspot.com

    _______________________________________________
    rabbitmq-discuss mailing list
    rabbitmq-discuss at lists.rabbitmq.com
    https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprabbitmq-discuss @
categoriesrabbitmq
postedJul 5, '11 at 5:10p
activeJul 14, '11 at 2:39p
posts2
users2
websiterabbitmq.com
irc#rabbitmq

People

Translate

site design / logo © 2022 Grokbase