Message to PubSub notification

4 posts / 0 new
Last post
Message to PubSub notification

Hey there,

I am developing a web app with a ReST API that I'd like to connect to an xmpp server (already running Tigase). I haven't worked out the details yet, but basically, I'd like users to be able to subscribe (using PubSub) to notifications of changes to particular resources in the ReST API.

I thought this would just take an few hours, but I hit a stumbling block: my web server (google app engine) can't send iq messages, which is how pubsub notifications happen. Ideally, I'd like the following setup:

1) Any logged on user should be able to subscribe to any resource.
2) only the AppEngine (ie a specific user on another host) should be allowed to send out notifications.
3) XMPP messages should be translated into XMPP PubSub notifications.

It seems to me that #1 is part of what pubsub does, so that's probably nothing to worry about. #2 is probably part of the configuration of pubsub, but maybe something I have to think more about. #3 is what concerns me. I have looked at the docs for building a "component" and it seems very doable, but I thought I would check here for advice/opinions/caveats/better ideas before I started down what might be an unnecessarily tricky path.




Why you can't send iq? Just add simple xmpp client to your app.


As I said in my post, I am using google app engine which cannot send IQ.

I am not sure if I understand this correctly. But from what I know about PubSub the point 3 is included in the PubSub spec and it is implemented already.
The only missing part is the link between your system and PubSub in Tigase. This can be done in many ways, depending what exactly you can do and how exactly you want it implement.
One of the most important questions I have to ask is about the load. How many users do you expect to have on your system, how many subscriptions to PubSub, how many notifications. And how many new updates in PubSub do you expect?
These are important questions, because you can probably implement it in a simpler but less efficient way, or more performant but also required more hard work.
In the simplest way, probably, you want to be able to accept REST calls to the Tigase server for PubSub subscriptions. I know of installations which integrate Jetty HTTP server into Tigase component. They accept HTTP calls and convert them to XMPP. This might be the simplest and quickest way I think. But performance of this solution will be limited.