History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: AMQ-1464
Type: Bug Bug
Status: Reopened Reopened
Priority: Major Major
Assignee: Hadrian Zbarcea
Reporter: Joe Fernandez
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

AMQ 5.0 Fanout Regression

Created: 15/Oct/07 11:14 AM   Updated: 30/Jul/08 08:13 AM
Component/s: JMS client
Affects Version/s: 5.0.0
Fix Version/s: 5.2.0

Time Tracking:
Not Specified

Environment: AMQ 5.0 - the 10/10/07 SNAPSHOT

Regression: Regression


 Description  « Hide
On 4.1.1, the fanout transport works as expected. My producer is fanning out message sends (queues) to two unrelated message brokers and clients connected to both those brokers get the messages.

However, when I run the same exact test under 5.0 (the 10/10 SNAPSHOT), fanout no longer works as expected Only the 5.0 broker that my producer first connects with gets the messages. The second broker never gets the messages and hurls this exception.

ERROR Service - Async error occurred: java.lang.IllegalStateException: Cannot remove a consumer that had not been registered: ID:DIEGO-3739-1192470567781-0:0:-1:1
java.lang.IllegalStateException: Cannot remove a consumer that had not been registered: ID:DIEGO-3739-1192470567781-0:0:-1:1
at org.apache.activemq.broker.TransportConnection.processRemoveConsumer(
TransportConnection.java:547)
at org.apache.activemq.command.RemoveInfo.visit(RemoveInfo.java:64)
at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:281)
at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:178)
at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:67)
at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:134)
at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:124)
at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:83)
at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:183)
at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:170)
at java.lang.Thread.run(Thread.java:595)

Joe



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Hiram Chirino - 22/Oct/07 07:29 AM
Hi Joe,

So are you saying that you are trying to fan out to two JMS Queues?? It seems like you are trying to deliver the message to two consumer, and if that's the case, you should be using Topics instead.


Joe Fernandez - 22/Oct/07 08:02 AM
Hi Hiram,

Yes, I am trying to fanout to two queues, each on two 'unrelated' brokers.
It works great on 4.1.1, but doesn't on 5.0.

Joe


Hiram Chirino - 22/Oct/07 10:30 AM
Um.. I think the problem is that this was 'fixed' since 4.1
Logically it does not make sense to fanout queues since messages sent to queues should only be consumed once. I'll add a option to the transport so that fanout on queues is also supported in the 5.0 release. Right now fanout is only fanning out messages to Topics.

Joe Fernandez - 22/Oct/07 11:06 AM
Hmm, here is what the fanout transport reference page states.

"The Fanout transport layers reconnect and replication logic on top of any
of the other transports. It is used replicate commands to multiple brokers."

Perhaps I am missing it, but nowhere in the documentation does it state that
the fanout can only be used for Topics.

My apologies for not properly interpreting the purpose of the fanout and
thus not using it in a logical manner; however, we do have a need to have a
producer "replicate" a message to two completely different systems and we
want the message consumed only once on each of those systems. The two
systems are completely separate from one another (i.e., the brokers and
consumers on those systems are not interconnected).


Hiram Chirino - 22/Oct/07 11:41 AM
Hi

As of revision 587188 the broker will now support at fanOutQueues option the defaults to false which enables fanning out on queues too. So to enable just update your URI to something like:

fanout://( discovery-agent )?fanOutQueues=true


Gary Watson - 01/Nov/07 02:48 PM
It appears that the Queues versus Topics issue has been resolved, with the addition of the new fanOutQueues option. However, the problem of java.lang.IllegalStateException remains.

I am using Topics with the 10/28/07 5.0 Snapshot. I have 2 standalone brokers, each connected to a Topic consumer. I start a Topic producer that uses fanout to connect to the 2 brokers. The messages that are sent by the producer are received by each consumer (good), but after the producer closes the session, one of the the brokers throws the exception "ERROR Service - Async error occurred: java.lang.IllegalStateException: Cannot remove a consumer that had not been registered" as Joe reported.


Hadrian Zbarcea - 30/Jul/08 08:13 AM
I added a test to the FanoutTransportBrokerTest for that and I cannot reproduce it. Please let us know if this is still an issue for you, or we could close it with a could not reproduce. Adding a unit test will also help a lot.

One other (quite important) thing I noticed is that the initial description mentioned that the feature did work in 4.1.1 so I assume that had to be topics not queues and Gary tested with topics too. I don't know how much sense would make to implement fan-out for queues as topics should be used in such a case. Could you please give more details why fan-out would be needed for queues?