Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: MB-460
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dejan Bosanac
Reporter: Stan Lewis
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
FUSE Message Broker

MessageConsumer.receive() does not throw an exception if the connection to the broker is lost.

Created: 25/Mar/09 12:33 PM   Updated: 25/May/09 01:46 PM
Component/s: None
Affects Version/s: 5.3.0.0-fuse
Fix Version/s: 5.0.0.28-fuse, 5.1.0.3-fuse

File Attachments: 1. Java Source File ConsumerTool.java (9 kB)



 Description  « Hide
If you don't set an ExceptionListener on the connection to the broker from within your consumer you won't get any notification if the connection to the broker has been lost, instead MessageConsumer.receive() will only return null or block indefinitely depending on if you use the timeout parameter or not. The JMS specification clearly states (section 4.3.8):
The exceptions delivered to ExceptionListener are those that have no other place
to be reported. If an exception is thrown on a JMS call it, by definition, must
not be delivered to an ExceptionListener (in other words, ExceptionListener is not
for the purpose of monitoring all exceptions thrown by a connection).

To reproduce this use my modified ConsumerTool.java, copy it into examples/src. Run the broker, then run the consumer like:

ant consumer -Dtopic=false -Dmax=10

Then run the producer like:

ant producer -Dtopic=false -Dmax=5

You'll see the consumer will get the 5 messages. Now Ctrl-C the broker and restart it. The consumer will still be running. If you run the producer again the consumer won't get the messages even though it's still blocked on MessageConsumer.receive().

Also note that if I do use the ExceptionListener on the connection object but take out the timeout parameter on line 182 in ConsumerTool.java if an exception is handled by the ExceptionListener the call to receive() is still blocked which means the example consumer won't exit when you bounce the broker.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Dejan Bosanac added a comment - 03/Apr/09 07:41 AM
Fixed in trunk. Will be merged into 5.3.0.1 version.

Dejan Bosanac added a comment - 25/May/09 01:46 PM
Fix merged into 5.0 branch.