[rabbitmq-discuss] Alternate Exchange Configuration Issue

Prashant prayadav at gmail.com
Tue Jan 25 14:24:02 GMT 2011


Hi ,

My bad . I had declared the exchange in the producer and did not
declare my alternate exchange there. Once I declared the exchange
properly unroutable messages were pushed to Alternate exchange.
I have a generic question though. In this scenario where I know all un
routable messages are in exchange ,can I somehow publish it back to my
original exchange( guess I need to simply use basicPublish with the
exchange name ) after a latency of somet time ?

My requirement as my earlier question in the forum is to tackle slow
consumers ( consumer that needs to perform some logic with remote
servers and there may be several reasons why the consumer can be
slow). I could either perform some checks to see if my remote server
is alive and then process the messages or use Lease Queue
approach.What I understood from the documentation is
1) Lease Queues
2) Per Queue TTL

Both of these approach  times out queue and message ( does that mean
all my  messages are lost or are they requed back in exchange ).
Please suggest.

Regds
Prashant

On Jan 25, 1:30 pm, Prashant <praya... at gmail.com> wrote:
> Hi ,
>
> the snippet you see is what I was referring to( from rabbitMQ site). I
> have defined an exchange called 'exchange' and declared it with
> arguments as in the code snippet.(groovy)
>
>         exchangeName = 'exchange'; queueName = 'myQueue'
>         args = new HashMap<String,Object>()
>         args.put("alternate-exchange", "my-ae")
>         channel.exchangeDeclare exchangeName, 'direct',false,false,args
>         channel.exchangeDeclare "my-ae", "fanout"
>         channel.queueDeclare "unrouted",false,false,false,null
>         channel.queueDeclare queueName,false,false,false,null
>         channel.queueBind "unrouted" , "my-ae" , ""
>         channel.queueBind queueName, exchangeName, 'rKey'
> Regds
> Prashant
>
> On Jan 24, 7:55 pm, Simon MacMullen <si... at rabbitmq.com> wrote:
>
> > On 24/01/2011 7:33PM, Prashant Yadav wrote:
> >  > Am experiencing trouble when configuring alternate exchange for my
> >  > broker. I am following the docs present in rabbitmq site. The error am
> >  > getting is
> >  >
> >  > Caused by: com.rabbitmq.client.ShutdownSignalException: channel error;
> >  > reason:
> >  > {#method<channel.close>(reply-code=406,reply-text=PRECONDITION_FAILED -
> >  > inequivalent arg 'alternate-exchange' for exchange 'exchange' in vhost
> >  > '/': required {longstr,<<97,101>>}, received
> >  > undefined,class-id=40,method-id=10),null,""}
>
> > Did you previously declare the exchange with a different alternate
> > exchange? (Or none?) Every declaration of an exchange needs to have the
> > same arguments.
>
> > BTW I note that your error message references an exchange called
> > "exchange" but your code references "my-direct".
>
> > Cheers, Simon
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss


More information about the rabbitmq-discuss mailing list