Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Stomp plugin closes connection on "inequivalent arg 'x-dead-letter-exchange'" error #16

Closed
michaelJustin opened this issue Jun 12, 2015 · 3 comments

Comments

@michaelJustin
Copy link

If the Stomp client tries to subscribe to a queue with a (mismatching) x-dead-letter-exchange set, the broker immediately closes the socket connection.

However, if the Stomp client tries to subscribe to a queue with a (mismatching) x-max-priority set, the broker sends a Stomp error frame back to the client with the error description, and does not close the connection.

I suggest to treat the first error situation in the same way, which allows to see the error message on the client side in the Stomp error frame in both cases.

Here is a broker log which shows the different server reactions to the mismatching queue args:

=ERROR REPORT==== 12-Jun-2015::11:37:01 ===
Channel error on connection <0.4321.0> (127.0.0.1:49446 -> 127.0.0.1:61613, vhost: '/', user: 'guest'), channel 1:
{amqp_error,precondition_failed,
"inequivalent arg 'x-max-priority' for queue 'priority_queue' in vhost '/': received none but current is the value '9' of type 'long'",
'queue.declare'}

=ERROR REPORT==== 12-Jun-2015::11:37:01 ===
STOMP error frame sent:
Message: precondition_failed
Detail: "PRECONDITION_FAILED - inequivalent arg 'x-max-priority' for queue 'priority_queue' in vhost '/': received none but current is the value '9' of type 'long'\n"
Server private detail: none

=INFO REPORT==== 12-Jun-2015::11:37:01 ===
closing STOMP connection <0.4318.0> (127.0.0.1:49446 -> 127.0.0.1:61613)

=INFO REPORT==== 12-Jun-2015::11:37:13 ===
accepting STOMP connection <0.4338.0> (127.0.0.1:49447 -> 127.0.0.1:61613)

=ERROR REPORT==== 12-Jun-2015::11:37:13 ===
Channel error on connection <0.4341.0> (127.0.0.1:49447 -> 127.0.0.1:61613, vhost: '/', user: 'guest'), channel 1:
{amqp_error,precondition_failed,
"inequivalent arg 'x-dead-letter-exchange' for queue 'queue_with_dlx' in vhost '/': received none but current is the value 'dlx.exchange.name' of type 'longstr'",
'queue.declare'}

=ERROR REPORT==== 12-Jun-2015::11:37:13 ===
** Generic server <0.4337.0> terminating
** Last message in was {'EXIT',<0.4347.0>,
{shutdown,
{server_initiated_close,406,
<<"PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-exchange' for queue 'queue_with_dlx' in vhost '/': received none but current is the value 'dlx.exchange.name' of type 'longstr'">>}}}
** When Server state == {state,"session-gfjnKs0tYwZu-ZqDNSSYbw",<0.4347.0>,
<0.4341.0>,
{dict,0,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
[]},
{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
[],[]}}},
"1.2",#Fun<rabbit_stomp_reader.1.50399846>,
undefined,
{stomp_configuration,"guest","guest",false,false},
{set,1,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
[]},
{{[],[],[],[],[],[],[],[],[],[],[],
[<<"queue_with_dlx">>],
[],[],[],[]}}},
{dict,0,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
[]},
{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
[],[]}}},
#Fun<rabbit_stomp_processor.5.63782375>,
{amqp_adapter_info,
{127,0,0,1},
61613,
{127,0,0,1},
49447,
<<"127.0.0.1:49447 -> 127.0.0.1:61613">>,
{'STOMP',0},
[{ssl,false}]},
#Fun<rabbit_stomp_reader.0.22944995>,none,
{127,0,0,1}}
** Reason for termination ==
** {channel_died,
{shutdown,
{server_initiated_close,406,
<<"PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-exchange' for queue 'queue_with_dlx' in vhost '/': received none but current is the value 'dlx.exchange.name' of type 'longstr'">>}}}

=INFO REPORT==== 12-Jun-2015::11:37:13 ===
closing STOMP connection <0.4338.0> (127.0.0.1:49447 -> 127.0.0.1:61613)

@michaelJustin
Copy link
Author

Stomp/debug log:

Stomp debug trace output from (Delphi) test program:

send:
CONNECT
login:guest
passcode:guest
accept-version:1.2
host:/

received:
CONNECTED
session:session-B5i6MFj6oP1dcIcye62kuQ
heart-beat:0,0
server:RabbitMQ/3.5.3
version:1.2

send:
SEND
destination:/queue/queue_with_dlx
content-type:text/plain

hello

send:
SUBSCRIBE
destination:/queue/queue_with_dlx
ack:client-individual
id:{CC0D9474-FC97-44A4-B278-2BC8A7DD9CE6}
x-dead-letter-exchange:dlx.exchange.name

Socket Error # 10053
Software caused connection abort.
send:
DISCONNECT
receipt:session-B5i6MFj6oP1dcIcye62kuQ

@priviterag
Copy link
Contributor

@michaelklishin I guess this works once we merge #26

@michaelklishin
Copy link
Member

The root cause is fixed in #27. You now can provide dead lettering headers as well as other known queue arguments, e.g. for TTL.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants