You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by sandeep reddy <sa...@in2m.com> on 2008/07/03 12:28:05 UTC
Error in setting up durable subscriber
I am trying to implement pub-sub model using durable subscription. But I am
getting exception for specifying unique clientID.
Following is my JMSConsumer configuration:
<jms:consumer service="up:DirectorConsumerService"
endpoint="directorConsumerEndpoint"
targetService="up:DirectorConsumerService"
pubSubDomain="true"
clientId="Director"
durableSubscriptionName="Director"
subscriptionDurable="true"
destinationName="updateUserProfileTopic"
connectionFactory="#connectionFactory"
messageSelector="userPrincipals LIKE '%sandeep2%'"/>
<jms:consumer service="up:PortalConsumerService"
endpoint="portalConsumerEndpoint"
targetService="up:PortalConsumerService"
pubSubDomain="true"
clientId="Portal"
durableSubscriptionName="Portal"
subscriptionDurable="true"
destinationName="updateUserProfileTopic"
connectionFactory="#connectionFactory"
messageSelector="userPrincipals LIKE '%smx%'"/>
Following is the error log:-
ERROR - DefaultMessageListenerContainer - Setup of JMS message listener
invoker
failed - trying to recover
javax.jms.JMSException: You cannot create a durable subscriber without
specifying a unique clientID
on a Connection
at
org.apache.activemq.ActiveMQConnection.checkClientIDWasManuallySpecified(ActiveMQConnection.java:1138)
at
org.apache.activemq.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:1066)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createConsumer
(AbstractPollingMessageListenerContainer.java:429)
I am not able to figure out the problem. Please help.
Sandeep.
--
View this message in context: http://www.nabble.com/Error-in-setting-up-durable-subscriber-tp18256291p18256291.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Error in setting up durable subscriber
Posted by sandeep reddy <sa...@in2m.com>.
This seems to be probable bug for new jms:consumer endpoint (for durable
subscription):
We are using new jms:consumer endpoints in our application for
publish-subscribe using topic. As we are
having multiple subscribers we are specifying unique clientID as part of
endpoint configuration. We tried
above suggested step by Bruce but still we are facing same error. We did
some troubleshooting on our
end to identify where could be the actual problem. Following are the steps
we did:
1) Modified the source code for ActiveMQ to have debug statements in the
setClientID(newClientID)
method and updated the jar file in ServiceMix with custom built version.
2) On ServiceMix start we see the logs being printed by JMSFlow class
which directly talks to
ActiveMQ.
3) The same logs are not printed during initialization of our
jms-consumer SU. This means that the
setClientID() method is never invoked for ActiveMQ connection. Difference
between jms-consumer
endpoint (JmsConsumerEndpoint) implementation and JMSFlow is that the
JmsConsumerEndpoint class
is using Spring to interact with ActiveMQ.
4) We have also browsed through the Spring code and everything seems to
be fine. There is method
prepareSharedConnection(Connection connection) in
AbstractJmsListeningContainer class. This method
actually sets the clientID to ActiveMQ connection object.
code: protected void prepareSharedConnection(Connection connection)
throws JMSException {
String clientId = getClientId();
if (clientId != null) {
connection.setClientID(clientId);
}
}
5) So, this method should execute before executing
org.apache.activemq.ActiveMQConnection.checkClientIDWasManuallySpecified().
Based on the log it is
clear that the preparedSharedConnection() method is not invoked.
6) And that leads to throwing JMSException:
javax.jms.JMSException: You cannot create a durable subscriber without
specifying a unique clientID on
a Connection
at
org.apache.activemq.ActiveMQConnection.checkClientIDWasManuallySpecified(ActiveMQConnection.java:1142)
at
org.apache.activemq.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:1066)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createConsumer(AbstractPollingMessageListenerContainer.java:429)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:216)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:297)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:254)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:871)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:811)
at java.lang.Thread.run(Thread.java:595)
Above findings seem to point to bug in JmsConsumerEndpoint. Please review
it.
We need to use new jms-endpoint as we require "messageSelector" which is not
possible with jms:endpoint (old).
Please help.
Sandeep
sandeep reddy wrote:
>
> Hi Bruce,
>
> Thanks for reply.
> I tried the way you suggested but it's again the same one.
> If you see the error it says that I need to mention with a unique
> clientId.And that's what I am doing.
>
> ERROR - DefaultMessageListenerContainer - Setup of JMS message listener
> invoker failed - trying to recover
> javax.jms.JMSException: You cannot create a durable subscriber without
> specifying a unique clientID on a Connection
> at
> org.apache.activemq.ActiveMQConnection.checkClientIDWasManuallySpecified(ActiveMQConnection.java:1138)
> at
> org.apache.activemq.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:1066)
>
> And I don't know might be this is bug for spring framework.Please help me
> ........
>
> Thanks,
> Sandeep.
>
>
> bsnyder wrote:
>>
>> On Sun, Jul 6, 2008 at 10:17 PM, sandeep reddy <sa...@in2m.com>
>> wrote:
>>>
>>> Hi All,
>>>
>>> Still i am not able to resolve this problem.I didn't understand is
>>> that
>>> nobody came across this problem,
>>> or else some thing missing in above configuration.
>>
>> Have you tried removing the clientId attribute from each
>> configuration? This value needs to be unique, it can't be a static
>> value as it causes the error you're seeing.
>>
>> Bruce
>> --
>> perl -e 'print
>> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> );'
>>
>> Apache ActiveMQ - http://activemq.org/
>> Apache Camel - http://activemq.org/camel/
>> Apache ServiceMix - http://servicemix.org/
>>
>> Blog: http://bruceblog.org/
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Error-in-setting-up-durable-subscriber-tp18256291p18341531.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Error in setting up durable subscriber
Posted by sandeep reddy <sa...@in2m.com>.
Hi servicemix-guys,
The problem that I mentioned in previous post is that is a bug for
servicemix or spring framework or
else is that some thing wrong with from my end.
Please provide some inputs.I get stuck......waiting for response.
Thanks,
Sandeep.
--
View this message in context: http://www.nabble.com/Error-in-setting-up-durable-subscriber-tp18256291p18361624.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Error in setting up durable subscriber
Posted by sandeep reddy <sa...@in2m.com>.
Hi,
This seems to be probable bug for new jms:consumer endpoint (for durable
subscription):
We are using new jms:consumer endpoints in our application for
publish-subscribe using topic. As we are having multiple subscribers we are
specifying unique clientID as part of endpoint configuration. We tried above
suggested step by Bruce but still we are facing same error. We did some
troubleshooting on our end to identify where could be the actual problem.
Following are the steps we did:
1) Modified the source code for ActiveMQ to have debug statements in the
setClientID(newClientID) method and updated the jar file in ServiceMix with
custom built version.
2) On ServiceMix start we see the logs being printed by JMSFlow class
which directly talks to ActiveMQ.
3) The same logs are not printed during initialization of our
jms-consumer SU. This means that the setClientID() method is never invoked
for ActiveMQ connection. Difference between jms-consumer endpoint
(JmsConsumerEndpoint) implementation and JMSFlow is that the
JmsConsumerEndpoint class is using Spring to interact with ActiveMQ.
4) We have also browsed through the Spring code and everything seems to
be fine. There is method prepareSharedConnection(Connection connection) in
AbstractJmsListeningContainer class. This method actually sets the clientID
to ActiveMQ connection object.
code: protected void prepareSharedConnection(Connection connection)
throws JMSException {
String clientId = getClientId();
if (clientId != null) {
connection.setClientID(clientId);
}
}
5) So, this method should execute before executing
org.apache.activemq.ActiveMQConnection.checkClientIDWasManuallySpecified().
And we noticed that preparedSharedConnection is not invoked.
6) And that leads to throwing JMSException:
javax.jms.JMSException: You cannot create a durable subscriber without
specifying a unique clientID on a Connection
at
org.apache.activemq.ActiveMQConnection.checkClientIDWasManuallySpecified(ActiveMQConnection.java:1142)
at
org.apache.activemq.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:1066)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createConsumer(AbstractPollingMessageListenerContainer.java:429)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:216)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:297)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:254)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:871)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:811)
at java.lang.Thread.run(Thread.java:595)
Above findings seem to point to bug in JmsConsumerEndpoint. Please review
it.
We need to use new jms-endpoint as we require "messageSelector" which is not
possible with jms:endpoint (old).
Please help.
Sandeep
--
View this message in context: http://www.nabble.com/Error-in-setting-up-durable-subscriber-tp18256291p18341652.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Error in setting up durable subscriber
Posted by sandeep reddy <sa...@in2m.com>.
Hi Bruce,
Thanks for reply.
I tried the way you suggested but it's again the same one.
If you see the error it says that I need to mention with a unique
clientId.And that's what I am doing.
ERROR - DefaultMessageListenerContainer - Setup of JMS message listener
invoker failed - trying to recover
javax.jms.JMSException: You cannot create a durable subscriber without
specifying a unique clientID on a Connection
at
org.apache.activemq.ActiveMQConnection.checkClientIDWasManuallySpecified(ActiveMQConnection.java:1138)
at
org.apache.activemq.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:1066)
And I don't know might be this is bug for spring framework.Please help me
........
Thanks,
Sandeep.
bsnyder wrote:
>
> On Sun, Jul 6, 2008 at 10:17 PM, sandeep reddy <sa...@in2m.com>
> wrote:
>>
>> Hi All,
>>
>> Still i am not able to resolve this problem.I didn't understand is
>> that
>> nobody came across this problem,
>> or else some thing missing in above configuration.
>
> Have you tried removing the clientId attribute from each
> configuration? This value needs to be unique, it can't be a static
> value as it causes the error you're seeing.
>
> Bruce
> --
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
>
> Blog: http://bruceblog.org/
>
>
--
View this message in context: http://www.nabble.com/Error-in-setting-up-durable-subscriber-tp18256291p18331605.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Error in setting up durable subscriber
Posted by Ulhas Bhole <ul...@iona.com>.
Hi Bruce,
I don't know much about the durable subscriber stuff but remember from
CXF JMS transport that I had to provide username/password along with
unique client ID in case of durable queue connection.
I am not sure if it's relevant here for this issue but thought might
clear my doubt also if it really needs the username/password where
username is unique and can be used as Durable subscriber id.
Regards,
Ulhas Bhole
Bruce Snyder wrote:
> On Sun, Jul 6, 2008 at 10:17 PM, sandeep reddy <sa...@in2m.com> wrote:
>
>> Hi All,
>>
>> Still i am not able to resolve this problem.I didn't understand is that
>> nobody came across this problem,
>> or else some thing missing in above configuration.
>>
>
> Have you tried removing the clientId attribute from each
> configuration? This value needs to be unique, it can't be a static
> value as it causes the error you're seeing.
>
> Bruce
>
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
Re: Error in setting up durable subscriber
Posted by Bruce Snyder <br...@gmail.com>.
On Sun, Jul 6, 2008 at 10:17 PM, sandeep reddy <sa...@in2m.com> wrote:
>
> Hi All,
>
> Still i am not able to resolve this problem.I didn't understand is that
> nobody came across this problem,
> or else some thing missing in above configuration.
Have you tried removing the clientId attribute from each
configuration? This value needs to be unique, it can't be a static
value as it causes the error you're seeing.
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Blog: http://bruceblog.org/
Re: Error in setting up durable subscriber
Posted by sandeep reddy <sa...@in2m.com>.
Hi All,
Still i am not able to resolve this problem.I didn't understand is that
nobody came across this problem,
or else some thing missing in above configuration.
Please help me, to get rid of this problem.
Thanks,
Sandeep.
sandeep reddy wrote:
>
> I am trying to implement pub-sub model using durable subscription. But I
> am getting exception for specifying unique clientID.
>
> Following is my JMSConsumer configuration:
>
> <jms:consumer service="up:DirectorConsumerService"
> endpoint="directorConsumerEndpoint"
> targetService="up:DirectorConsumerService"
> pubSubDomain="true"
> clientId="Director"
> durableSubscriptionName="Director"
> subscriptionDurable="true"
> destinationName="updateUserProfileTopic"
> connectionFactory="#connectionFactory"
> messageSelector="userPrincipals LIKE '%sandeep2%'"/>
>
> <jms:consumer service="up:PortalConsumerService"
> endpoint="portalConsumerEndpoint"
> targetService="up:PortalConsumerService"
> pubSubDomain="true"
> clientId="Portal"
> durableSubscriptionName="Portal"
> subscriptionDurable="true"
> destinationName="updateUserProfileTopic"
> connectionFactory="#connectionFactory"
> messageSelector="userPrincipals LIKE '%smx%'"/>
>
> Following is the error log:-
>
> ERROR - DefaultMessageListenerContainer - Setup of JMS message listener
> invoker
> failed - trying to recover
> javax.jms.JMSException: You cannot create a durable subscriber without
> specifying a unique clientID
> on a Connection
> at
> org.apache.activemq.ActiveMQConnection.checkClientIDWasManuallySpecified(ActiveMQConnection.java:1138)
> at
> org.apache.activemq.ActiveMQSession.createDurableSubscriber(ActiveMQSession.java:1066)
> at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createConsumer
> (AbstractPollingMessageListenerContainer.java:429)
>
>
> I am not able to figure out the problem. Please help.
>
> Sandeep.
>
--
View this message in context: http://www.nabble.com/Error-in-setting-up-durable-subscriber-tp18256291p18309796.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.