You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "pshetty.kateel" <ps...@gmail.com> on 2013/04/08 16:16:13 UTC

Camel xmpp dynamic router is not connecting to openfire.

Hi,

I am using camel xmpp and dynamic router configuration as below.
Here in xmpp we are using group chat.

<camel:route id="eventSubscriber">
			<camel:from uri="ref:eventReceiverUri" />
			 <camel:dynamicRouter>	          
	            <camel:method ref="eventRouterBean" method="processEvent"/>
	        </camel:dynamicRouter>
		</camel:route>	

In eventRouterBean's processEvent method, we are building xmpp groupchat
room url depending upon the message and forwading the same message into
respective groupchatrooms.
If resulting groupchat room is not existing, it will log message 
WARN 2013-04-05 17:55:48,190 (UnitOfWorkProcessor.java processAsync:162) -
Caught unhandled exception while processing ExchangeId:
ID-INGBTCPIC8NB038-63130-1365164745141-0-3
org.apache.camel.FailedToCreateProducerException: Failed to create Producer
for endpoint:
Endpoint[xmpp://ingbtcpic8nb038:5222/?password=******&resource=zone_4fc100e4-d004-4a0b-a7e2-7cf910585af6_51&room=zone_4fc100e4-d004-4a0b-a7e2-7cf910585af6_51%40conference.ispf.com&serviceName=ispf.com&user=messagepublisher%40ispf.com].
Reason: not-allowed(405)
	at
org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:395)
	at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:278)
	at
org.apache.camel.processor.RoutingSlip.processExchange(RoutingSlip.java:280)
	at
org.apache.camel.processor.RoutingSlip.doRoutingSlip(RoutingSlip.java:205)
	at org.apache.camel.processor.RoutingSlip.process(RoutingSlip.java:135)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
and ......
Caused by: not-allowed(405)
	at org.jivesoftware.smackx.muc.MultiUserChat.join(MultiUserChat.java:501)
	at
org.apache.camel.component.xmpp.XmppGroupChatProducer.doStart(XmppGroupChatProducer.java:84)
	at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
	at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:62)
	at
org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:393)
	... 40 more

This is still fine.
But issue is if I create a groupchat room memeber permission in openfire, it
should forward new incoming message to same groupchat room. But it is not
forwarding. It is keep on logging same error message.

But if I restart the camel context. Then it starts working.
Looks like it is caching url and its connection as not allowed in dynamic
router.
What will be the solution?
And even the exception is thowing at ProducerCache.doGetProducer()..
So how clear cache for failed connections.

Moreover I need to have auto-reconnection to openfire, if it goes down and
up
 



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-xmpp-dynamic-router-is-not-connecting-to-openfire-tp5730506.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel xmpp dynamic router is not connecting to openfire.

Posted by "pshetty.kateel" <ps...@gmail.com>.
I forgot mention the kind exception for 2nd and later messages.

Exception is thrown at  chat = new MultiUserChat(connection, room);
statement of XmppGroupChatProducer's doStart() method. Exception says 'Not
connected to the server'. So It means that we need to reconnect and
authenticate it if disconnected from earlier unit of work.



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-xmpp-dynamic-router-is-not-connecting-to-openfire-tp5730506p5730537.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel xmpp dynamic router is not connecting to openfire.

Posted by "pshetty.kateel" <ps...@gmail.com>.
I have added comment to JIRA issue



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-xmpp-dynamic-router-is-not-connecting-to-openfire-tp5730506p5730964.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel xmpp dynamic router is not connecting to openfire.

Posted by Christian Müller <ch...@gmail.com>.
Check The JIRA issue.

Sent from a mobile device
Am 15.04.2013 21:30 schrieb "namita" <na...@gmail.com>:

> Hi All,
>
> Please give  updates about this issue?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-xmpp-dynamic-router-is-not-connecting-to-openfire-tp5730506p5730938.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel xmpp dynamic router is not connecting to openfire.

Posted by namita <na...@gmail.com>.
Hi All,

Please give  updates about this issue?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-xmpp-dynamic-router-is-not-connecting-to-openfire-tp5730506p5730938.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel xmpp dynamic router is not connecting to openfire.

Posted by namita <na...@gmail.com>.
Hi, any updates with this issue?Is this fixed?May I know how much time it
takes to get it resolved?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-xmpp-dynamic-router-is-not-connecting-to-openfire-tp5730506p5730711.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel xmpp dynamic router is not connecting to openfire.

Posted by "pshetty.kateel" <ps...@gmail.com>.
Created Jira issue

https://issues.apache.org/jira/browse/CAMEL-6256



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-xmpp-dynamic-router-is-not-connecting-to-openfire-tp5730506p5730601.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel xmpp dynamic router is not connecting to openfire.

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah this indicates a bug. Feel free to log a JIRA ticket and work on a patch.
http://camel.apache.org/contributing.html

On Mon, Apr 8, 2013 at 10:19 PM, pshetty.kateel
<ps...@gmail.com> wrote:
> I just debugged using source code.
> It looks like bug in XmppEndpoint.createConnection method.
>
> If no groupchat room is avalilable, then XmppGroupChatProducer's method
> doStart;  chat.join() statement will throw exception.
> Upon this exception, ServiceSupport.stop() is trggered. This triggers
> XmppGroupChatProducer's doStop() method.  Here it disconnects the connection
> and sets null. Till here pretty much clear.  But XmppEndpoint's connection
> variable still holds the old connection object and it is in disconnected and
> unauthorised state.
>
> For next successive messages, XmppEndpoint.createConnection will return the
> old connection object, but it is in disconnected state.   Because of this,
> always we will have connection with disconnected and unauthenticated state.
> So I feel 'createConnection' not only need to check  for null, but also it
> should also check for connected state and authenticated state.
>
>
> If anyone feels 'XmppEndpoint.createConnection ' is very much correct, then
> we need to modify XMPPGroupChatProducer's doStart() or doStop() method.
>
> I still go with XmppEndpoint.createConnection  method changes.
>
> or
> Anyother alternative to solve this as I am not fully aware of camel and xmpp
> codebase?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-xmpp-dynamic-router-is-not-connecting-to-openfire-tp5730506p5730534.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camel xmpp dynamic router is not connecting to openfire.

Posted by "pshetty.kateel" <ps...@gmail.com>.
I just debugged using source code.
It looks like bug in XmppEndpoint.createConnection method.

If no groupchat room is avalilable, then XmppGroupChatProducer's method
doStart;  chat.join() statement will throw exception.
Upon this exception, ServiceSupport.stop() is trggered. This triggers
XmppGroupChatProducer's doStop() method.  Here it disconnects the connection
and sets null. Till here pretty much clear.  But XmppEndpoint's connection
variable still holds the old connection object and it is in disconnected and
unauthorised state.

For next successive messages, XmppEndpoint.createConnection will return the
old connection object, but it is in disconnected state.   Because of this,
always we will have connection with disconnected and unauthenticated state.
So I feel 'createConnection' not only need to check  for null, but also it
should also check for connected state and authenticated state.


If anyone feels 'XmppEndpoint.createConnection ' is very much correct, then
we need to modify XMPPGroupChatProducer's doStart() or doStop() method.

I still go with XmppEndpoint.createConnection  method changes.

or 
Anyother alternative to solve this as I am not fully aware of camel and xmpp
codebase?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-xmpp-dynamic-router-is-not-connecting-to-openfire-tp5730506p5730534.html
Sent from the Camel - Users mailing list archive at Nabble.com.