views:

66

answers:

1

I need to receive an update published to a JMS topic, convert it to a XMPP packet (Presence packet or PubSub packet) and route it to an XMPP endpoint.

I am using ActiveMQ as JMS provider and Apache camel as routing engine. given below is my route in Camel (to make things simple I read from system.in instead of a jms topic):

     from("stream:in?promptMessage=Enter something:").process( new Processor(){
        public void process(Exchange exchange) throws Exception {
                System.out.println("sending presence with message: " + exchange.getIn().getBody().toString());
                Presence p = new Presence(Type.available, exchange.getIn().getBody().toString(), 5, Mode.chat);
                exchange.getIn().setBody(p);
            }
            }).to("xmpp:user1@banl080161?password=pass1");

Idea is that user1@banl080161 should be able to send a custome presence packet having status as given from system.in. I am reading from system.in, making a presence packet, setting this packet in the exchange body and send this presence on behalf of user1@banl080161.

Problem: nothing gets sent to XMPP server, I use PSI to see packets coming from user1@banl080161, user1@banl080161 comes online for sure but no custom presence message is received.

Is it possible to do this kind of thing in apache camel?

A: 

Please feel free to create a ticket for this new feature to the camel-xmpp component.

There is a link to the issue tracker from this web page: http://camel.apache.org/support

Claus Ibsen
Thanks Claus, I added the new ticket (https://issues.apache.org/activemq/browse/CAMEL-3195)
CPJoshi
Claus, I have attached a patch for this feature. In case you have some time, please have a look. Your comments/feedback is welcome.
CPJoshi
Thanks a lot for the patch. Yeah we will take a look. Just that we want to get Camel 2.5 out of the door first.
Claus Ibsen