powered by Jive Software

REST service implementation for external component


#1

Hi,

We want to use Whack to implement an external Openfire component which will receive some information (payload/from/to) from an external service and will send it through the component as a valid XMPP user.

Can we use Openfire’s internal Jetty engine to implement this REST service endpoint similar to Creating Web Services and a Rest Server with JAX-RS and Jetty | Java Code Geeks ? Any other suggestions?


#2

Could you explain which kind of feature do you want to implement?

Maybe you can use the REST API plugin which provides a lot of functionality: REST API Plugin Readme

Feature list: REST API Plugin Readme


#3

We want a rest service to listen for JSON calls and send out (push) XMPP messages impersonating a XMPP user.

The JSON messages will contain parameters for XMPP message from/to/payload.

The REST API plugin does not include this functionality (push XMPP messages impersonating a XMPP user)


#4

You could also extend the REST API Plugin to send messages to specific User.

Feel free to make a Pull Request on Github (igniterealtime/Openfire · GitHub ). If you need any help by the Plugin you can contact me.


#5

Yes, that would be an approach. However, the full project contains another part, that of converting inbound XMPP messages to JSON messages (from/to/payload as parameters) and pushing them to a REST service.

Hence, either a complete external component app can be devised to cater both functionalities or one (inbound) will be implemented as an external component application and the other (outbound) through the REST API extension. However, the XMPP clients will recognise (an expect replies from) the user@componentname.myxmppdomain.com user. Can the REST API send outbound messages as an external component user or only as a direct attached-to-server XMPP user? This has to be investigated… on the to-do list…


#6

It would be possible to send XMPP message over REST API to local and attached servers/components. But not request messages which was send back to you.