Hello,
I am calling Publish(...), but Publish(...) does not return Ampq.Error as expected when the RabbitMQ exchange does not exist. The expectation I have is Publish(...) returns Ampq.Error if something is wrong with the channel. One way to avoid this is to create the exchange, but I am more concerned that Publish may be returning Ampq.Ok erroneously in other situations. Any suggestions?
Code:
val publisherFuture = publisher ? Publish(RabbitMQConfig.Exchange,
routingKey,
json.getBytes,
Some(properties),
mandatory = true)
val publisherResult = Await.result(publisherFuture, timeout.duration)
logger.info("Result: " + publisherResult)
Log:
01:03:33.491 [CreateAssetsActorSpec-akka.actor.default-dispatcher-7] DEBUG com.github.sstone.amqp.ChannelOwner - publishing Publish(dsa.exchange,private.asset.create,[B@285ab390,Some(#contentHeader(content-type=null, content-encoding=null, headers=null, delivery-mode=2, priority=null, correlation-id=61d52810-1b36-11e3-a15e-0800276c71c2, reply-to=null, expiration=null, message-id=61d52810-1b36-11e3-a15e-0800276c71c2, timestamp=null, type=null, user-id=null, app-id=null, cluster-id=null)),true,false)
01:03:33.501 [pool-60-thread-2] INFO c.g.d.m.s.c.v1.CreateAssetsActor - Result: Ok(Publish(dsa.exchange,private.asset.create,[B@285ab390,Some(#contentHeader(content-type=null, content-encoding=null, headers=null, delivery-mode=2, priority=null, correlation-id=61d52810-1b36-11e3-a15e-0800276c71c2, reply-to=null, expiration=null, message-id=61d52810-1b36-11e3-a15e-0800276c71c2, timestamp=null, type=null, user-id=null, app-id=null, cluster-id=null)),true,false),None)
01:03:33.522 [ForkJoinPool-3-worker-1] INFO c.g.d.m.s.c.v1.CreateAssetsActor - Asset metadata for masterId(3703) successfully inserted into MessageBroker - Actor[akka://CreateAssetsActorSpec/deadLetters] -- Actor[akka://CreateAssetsActorSpec/system/testActor1#1754928134]
01:03:33.539 [CreateAssetsActorSpec-akka.actor.default-dispatcher-3] ERROR com.github.sstone.amqp.ChannelOwner - channel was shut down
com.rabbitmq.client.ShutdownSignalException: channel error; reason: {#method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no exchange 'dsa.exchange' in vhost 'dsa', class-id=60, method-id=40), null, ""}
at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:474) ~[amqp-client-3.1.3.jar:na]
at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:315) ~[amqp-client-3.1.3.jar:na]
at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:144) ~[amqp-client-3.1.3.jar:na]
at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:91) ~[amqp-client-3.1.3.jar:na]
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:533) ~[amqp-client-3.1.3.jar:na]
01:03:33.539 [CreateAssetsActorSpec-akka.actor.default-dispatcher-3] WARN com.github.sstone.amqp.ChannelOwner - disconnected
01:03:33.539 [CreateAssetsActorSpec-akka.actor.default-dispatcher-3] INFO akka.actor.RepointableActorRef - Message [akka.actor.FSM$Transition] from Actor[akka://CreateAssetsActorSpec/user/management-connection/$a#1723353950] to Actor[akka://CreateAssetsActorSpec/user/$a#937797823] was not delivered. [1] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
01:03:33.540 [CreateAssetsActorSpec-akka.actor.default-dispatcher-3] INFO com.github.sstone.amqp.ChannelOwner - connected