开发者

How do I implement a Rails push notification service consumer over XML/HTTP?

I'm trying to write an XML over HTTP push notification consumer that accepts the push notifications and parses the XML and saves the data in the database. I've looked at the Nokogiri gem which is a neat XML parser. What fails me is that I plan to only accept the notifications when a user on my app subscribes to receive their activity feed.

So, I'm expecting the notification in this format <?xml version="1.0" encoding="UTF-8"?> <Activities xmlns=""> <RecordSet> <Record> <ACTIVITY_DATE>2011-05-10</ACTIVITY_DATE> <ACTIVITY_TYPE>FOO</ACTIVITY_TYPE> <ACCOUNT_ID>0123456789</ACCOUNT_ID> <SENDER_FIRST_NAME>John</SENDER_FIRST_NAME> <SENDER_MIDDLE_NAME>S.</SENDER_MIDDLE_NAME> <SENDER_LAST_NAME>Karanja</SENDER_LAST_NAME> </Record> ... </RecordSet> </Activities>

I am expected to respond by sending an XML with a status code back to the notification server. I have looked at this example and this

but both seem not to address my needs. How would I go about this, especially how to keep an open pipe for incoming notifications. And is there such a rubygem that is ta开发者_运维知识库ilored for this?


This should be an interesting resource: http://redis.io/topics/pubsub

It Allows people to subscribe etc...

Another solution lies with Faye covered by a Railscast.

Once the push system implemented, you'll need to parse the data but you should use json as most push systems use javascript.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜