mefesto/wabbitmq — Issue #3: Reconnect when channel has been shut down
Author: pjlegato
Created: 2012-02-27 02:48:13+00:00
State: open

Is there any way to make WabbitMQ re-open a channel re-open if it's been closed?

I get the below exception every time, even though I'm re-running (with-broker) and (with-channel) anew around the operation. As far as I can tell, *channel* and *connection* are both nil in both my namespace and in com.mefesto.wabbitmq, so I can't figure out where it's storing the old channel reference -- in a closure somewhere?

```
clean connection shutdown; reason: Attempt to use closed channel
[Thrown class com.rabbitmq.client.AlreadyClosedException]

Restarts:
0: [QUIT] Quit to the SLIME top level

Backtrace:
0: com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:195)
1: com.rabbitmq.client.impl.AMQChannel.processShutdownSignal(AMQChannel.java:263)
2: com.rabbitmq.client.impl.ChannelN.processShutdownSignal(ChannelN.java:200)
3: com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:408)
4: com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:360)
5: com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:353)
6: sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
7: sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
8: java.lang.reflect.Method.invoke(Method.java:597)
9: clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:92)
10: clojure.lang.Reflector.invokeNoArgInstanceMember(Reflector.java:316)
11: com.mefesto.wabbitmq$with_channel_STAR_.invoke(wabbitmq.clj:111)