You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Tomas Restrepo <to...@devdeo.com> on 2007/03/29 04:10:48 UTC
amq.topic and undelivered messages
I've been working a bit today on making sure the .NET client handles
undelivered messages gracefully (right now it doesn't quite do it), and
making sure that the returned message is properly handled and the correct
exception is notified through the connection (though from an API point of
view, I think this is horrendous, but that's a different story).
As part of this, I've added the proper exceptions, handled bounced messages
in the channel and I'm fixing the UnderliverableTest test in
Qpid.Client.Tests, which pretty much didn't work (it didn't test anything as
it was).
So far, I've got everything working pretty nicely, except for underliverable
messages sent to a topic exchange.
I've checked everything, and indeed the java broker sees the message and the
debug logs show it indeed recognizes it as undeliverable. However, it never
sends a Basic-Return frame back to the client notifying it of the problem,
like it happens with the direct and header exchanges. (I've verified traffic
with a protocol analyzer, btw, so I'm sure the frame is not sent over the
network)
So the question would be: Is this expected for a topic exchange? Or am I
just hitting a problem with the java broker? Any ideas?
Tomas Restrepo
http://www.winterdom.com/weblog/
Re: amq.topic and undelivered messages
Posted by Gordon Sim <gs...@redhat.com>.
Tomas Restrepo wrote:
>> I believe only messages published with the mandatory flag set will be
>> returned if there are no matching bindings. Can you verify whether that
>> flag is set?
>
> Yes, the flag is set. In fact, the test code is exactly the same for all
> four exchanges tested (default, direct, topic and headers), the only
> difference is the exchange selected.
Sorry Tomas, I should have looked at the code first and wouldn't have
needed to pester you with silly questions!
The java broker currently checks the mandatory flag for the direct and
headers exchange but not for the topic exchange. I'll raise a JIRA.
The c++ broker doesn't obey mandatory at all; this was in anticipation
of changes in that area of the specification. However I'll raise a JIRA
for that as well.
RE: amq.topic and undelivered messages
Posted by Tomas Restrepo <to...@devdeo.com>.
Hi Gordon,
> By undeliverable I'm assuming you mean that the exchange to which the
> message is published has no bindings that match the message. (If the
> exchange wasn't recognised the broker should close the channel with a
> 404).
I'm indeed talking about the first case you mention.
> I believe only messages published with the mandatory flag set will be
> returned if there are no matching bindings. Can you verify whether that
> flag is set?
Yes, the flag is set. In fact, the test code is exactly the same for all
four exchanges tested (default, direct, topic and headers), the only
difference is the exchange selected.
Here's the basic.publish packet in fact:
Advanced Message Queueing Protocol
Type: Method (1)
Channel: 1
Length: 41
Class: Basic (60)
Method: Publish (40)
Arguments
Ticket: 0
Exchange: amq.topic
Routing-Key: Non-existant route key!
.... ...1 = Mandatory: True
.... ..0. = Immediate: False
Advanced Message Queueing Protocol
Type: Content header (2)
Channel: 1
Length: 49
Class ID: Basic (60)
Weight: 0
Body size: 5
Property flags: 0xfffc
Properties
Content-Type: text/plain
Content-Encoding:
Headers
Delivery-Mode: 2
Priority: 0
Correlation-Id:
Reply-To:
Expiration: 0
Message-Id:
Timestamp: 633107639307039840
Type:
User-Id:
App-Id:
Cluster-Id:
Tomas Restrepo
http://www.winterdom.com/weblog/
Re: amq.topic and undelivered messages
Posted by Gordon Sim <gs...@redhat.com>.
Tomas Restrepo wrote:
> So far, I've got everything working pretty nicely, except for underliverable
> messages sent to a topic exchange.
>
> I've checked everything, and indeed the java broker sees the message and the
> debug logs show it indeed recognizes it as undeliverable. However, it never
> sends a Basic-Return frame back to the client notifying it of the problem,
> like it happens with the direct and header exchanges. (I've verified traffic
> with a protocol analyzer, btw, so I'm sure the frame is not sent over the
> network)
>
> So the question would be: Is this expected for a topic exchange? Or am I
> just hitting a problem with the java broker? Any ideas?
By undeliverable I'm assuming you mean that the exchange to which the
message is published has no bindings that match the message. (If the
exchange wasn't recognised the broker should close the channel with a 404).
I believe only messages published with the mandatory flag set will be
returned if there are no matching bindings. Can you verify whether that
flag is set?