You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Ga...@gmx.de on 2013/06/23 13:12:31 UTC
xmpp uri in camel / naming a hid resource
Hello,
I doubt that I understood how to name a jid-resource when using Apache Camel. Perhaps it is not even possible because the xmpp endpoint will take what I intent to be a resource as an participant.
format for an xmpp url in camel: xmpp://[login@]hostname[:port][/participant][?Options]
format of a jid: node@domain/resource
Background:
I want to use xmpp in order to access a central application (which is behind a firewall I have no influence on) from various clients. The xmpp server will be the coordinator for all the clients which send commands to the central applicatoin which in turn will answer. I will create one openfire user per installation (an installation is the combination of 1 central application and n clients accessing it).
The idea is then to have the clients logged into the xmpp server and have a jabber ressource set accordingly to differentiate between them. I want to create only one account per installation.
In a picture the communication will look like this:
+-------------------------------------+
| application: |
| installation1@xmpp.srv.net/app |
+-------------------------------------+
I
I
I
+-------------------------------------+
| XMPP Server |
| hostname: xmpp.srv.net
+-------------------------------------+
/ \
/ \
/ \
+-------------------------------------- +--------------------------------------
| contacting device #1 | | contacting device #n |
| installation@xmpp.srv.net/device1 | | installation@xmpp.srv.net/devicen |
+-------------------------------------- +--------------------------------------
Question:
How should I address the application from device1 and make sure that an outgoing answer to the request only reaches that device and no other device ?
I would have expected something like this, but this is where the interpretation of the "/" comes into my way:
from device to application:
xmpp://installation1@xmpp.srv.net/device1/installation1@xmpp.srv.net/app?password=kept&message=whatIsTwoTimesFour
from application to device:
xmpp://installation1@xmpp.srv.net/app/installation1@xmpp.srv.net/device1?passwort=secret&message=8
Any other comments concerning what I plan to do are welcome because the idea is quite new and I don't know if this is the ideal way !
But please don't comment on my drawing skills in ASCII art ;-)
Re: xmpp uri in camel / naming a JID resource [solved]
Posted by Willem jiang <wi...@gmail.com>.
Thanks for sharing this with us :)
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Wednesday, June 26, 2013 at 3:46 AM, Garbage wrote:
> I reread the documentation on the XMPP component
> (http://camel.apache.org/xmpp.html) and rearranged the url from an earlier
> attempt. It now works, I can use one account and vary it by adding a
> resource.
>
> Here you can find an example:
>
> from("stream:in?promptMessage=sachwas:").to("xmpp:installation1@xmpp.srv.net?resource=app&password=yes&participant=installation1@xmpp.srv.net/device1 (mailto:installation1@xmpp.srv.net?resource=app&password=yes&participant=installation1@xmpp.srv.net/device1)");
>
> This logs on the user as "installation1@xmpp.srv.net (mailto:installation1@xmpp.srv.net)/app" and has it send
> the entered message to the same user but with a different active resource
> ("installation1@xmpp.srv.net (mailto:installation1@xmpp.srv.net)/device").
> Now I can proceed and add marshalling and remoting ...
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/xmpp-uri-in-camel-naming-a-hid-resource-tp5734609p5734766.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: xmpp uri in camel / naming a JID resource [solved]
Posted by Garbage <Ga...@gmx.de>.
I reread the documentation on the XMPP component
(http://camel.apache.org/xmpp.html) and rearranged the url from an earlier
attempt. It now works, I can use one account and vary it by adding a
resource.
Here you can find an example:
from("stream:in?promptMessage=sachwas:").to("xmpp:installation1@xmpp.srv.net?resource=app&password=yes&participant=installation1@xmpp.srv.net/device1");
This logs on the user as "installation1@xmpp.srv.net/app" and has it send
the entered message to the same user but with a different active resource
("installation1@xmpp.srv.net/device").
Now I can proceed and add marshalling and remoting ...
--
View this message in context: http://camel.465427.n5.nabble.com/xmpp-uri-in-camel-naming-a-hid-resource-tp5734609p5734766.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: xmpp uri in camel / naming a hid resource
Posted by Willem jiang <wi...@gmail.com>.
Hi,
I think it is make sense to treat the installation as a chat room, then you can let the application and device talk to each other.
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Sunday, June 23, 2013 at 7:12 PM, Garbage@gmx.de wrote:
>
>
> Hello,
> I doubt that I understood how to name a jid-resource when using Apache Camel. Perhaps it is not even possible because the xmpp endpoint will take what I intent to be a resource as an participant.
> format for an xmpp url in camel: xmpp://[login@]hostname[:port][/participant][?Options]
> format of a jid: node@domain/resource
> Background:
> I want to use xmpp in order to access a central application (which is behind a firewall I have no influence on) from various clients. The xmpp server will be the coordinator for all the clients which send commands to the central applicatoin which in turn will answer. I will create one openfire user per installation (an installation is the combination of 1 central application and n clients accessing it).
> The idea is then to have the clients logged into the xmpp server and have a jabber ressource set accordingly to differentiate between them. I want to create only one account per installation.
> In a picture the communication will look like this:
>
> +-------------------------------------+
> | application: |
> | installation1@xmpp.srv.net (mailto:installation1@xmpp.srv.net)/app |
> +-------------------------------------+
> I
> I
> I
> +-------------------------------------+
> | XMPP Server |
> | hostname: xmpp.srv.net (http://xmpp.srv.net)
> +-------------------------------------+
> / \
> / \
> / \
> +-------------------------------------- +--------------------------------------
> | contacting device #1 | | contacting device #n |
> | installation@xmpp.srv.net (mailto:installation@xmpp.srv.net)/device1 | | installation@xmpp.srv.net (mailto:installation@xmpp.srv.net)/devicen |
> +-------------------------------------- +--------------------------------------
>
> Question:
> How should I address the application from device1 and make sure that an outgoing answer to the request only reaches that device and no other device ?
> I would have expected something like this, but this is where the interpretation of the "/" comes into my way:
> from device to application:
> xmpp://installation1@xmpp.srv.net (mailto:installation1@xmpp.srv.net)/device1/installation1@xmpp.srv.net (mailto:installation1@xmpp.srv.net)/app?password=kept&message=whatIsTwoTimesFour
> from application to device:
> xmpp://installation1@xmpp.srv.net (mailto:installation1@xmpp.srv.net)/app/installation1@xmpp.srv.net (mailto:installation1@xmpp.srv.net)/device1?passwort=secret&message=8
> Any other comments concerning what I plan to do are welcome because the idea is quite new and I don't know if this is the ideal way !
> But please don't comment on my drawing skills in ASCII art ;-)