Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StompJmsDurableTopicSubscriber not registering as durable subscriber on ActiveMQ 5.8.0 from Camel. #9

Open
jhberges opened this issue Feb 13, 2013 · 2 comments

Comments

@jhberges
Copy link

I can see in the debugger that it is StompJmsDurableTopicSubscriber that is used, and the TRACE level logging on the stomp connector in ActiveMQ yields:

2013-02-13 12:45:25,737 | TRACE | Sending: 
CONNECTED
heart-beat:0,0
session:ID:8100-007-1502-1360754670225-2:33
server:ActiveMQ/5.8.0
version:1.1

2013-02-13 12:45:25,752 | TRACE | Received: 
SUBSCRIBE
ack:client
receipt:2
destination:/topic/blabla.topic
id:1
persistent:true

Spring configuration:

<bean id="stomper" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="stompConnectionFactory" />
</bean>

<bean id="stompConnectionFactory" class="org.fusesource.stomp.jms.StompJmsConnectionFactory">
    <property name="brokerURI" value="${activeMqInstance}"/>
    <property name="username" value="${activeMqUsername}"/>
    <property name="password" value="${activeMqPassword}"/>
</bean>

And the "activeMqInstance" variable is set to:

tcp://localhost:61613

(i.e "stomp+nio")

The Camel consumer is declared as:

<camel:from uri="stomper:topic:blabla.topic?clientId=stomper-blabla&amp;durableSubscriptionName=stomper-blabla"/>

The result is that the "stomper-blabla" consumer is connected as an ephemeral consumer, and does not assume the role of the configured durable one.

@chirino
Copy link
Member

chirino commented Feb 13, 2013

Yep. that's a problem. I've just committed a change so that the client detects that you are talking to ActiveMQ and sends the right headers for ActiveMQ on the subscribe frame. Try out the new 1.14-SNAPSHOT and let now if that works better for you.

@jhberges
Copy link
Author

Thanks for the reply!

Tried 1.14-SNAPSHOT from "Fusesource Snapshots", with the same setup as above.
This is what was logged by the wireFormat TRACE logging:

2013-02-14 08:38:01,857 | TRACE | Received: 
CONNECT
host:localhost
accept-version:1.1
client-id:stomper-blabla
passcode:*****
login:app_blabla

2013-02-14 08:38:01,857 | DEBUG | Stomp Inactivity Monitor read check: 0, write check: 0 | org.apache.activemq.transport.stomp.StompInactivityMonitor | ActiveMQ NIO Worker 2
2013-02-14 08:38:01,857 | DEBUG | Stomp Connect heartbeat conf RW[0,0] | org.apache.activemq.transport.stomp.ProtocolConverter | ActiveMQ NIO Worker 2
2013-02-14 08:38:01,873 | TRACE | Sending: 
CONNECTED
heart-beat:0,0
session:stomper-blabla
server:ActiveMQ/5.8.0
version:1.1

2013-02-14 08:38:01,888 | TRACE | Received: 
SUBSCRIBE
activemq.subscriptionName:1
ack:client
receipt:2
destination:/topic/blabla.topic
id:1

2013-02-14 08:38:01,888 | TRACE | Sending: 
RECEIPT
receipt-id:2

Seems like a discrepancy between "client-id" header in the "CONNECT" frame and the "activemq.subscriptionName" header in the "SUBSCRIBE" frame?
(ref http://activemq.apache.org/stomp.html#Stomp-ActiveMQextensionstoStomp)

Without diving too deep into it, I note that the StompJmsSession class on line 381 feeds the StompJmsTopicSubscriber an id from "getChannel().nextId()" - which sounds like a sequencer?

Thanks
// JHB

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

No branches or pull requests

2 participants