Pergunta

I am in the process of interfacing to a RESTful API for a proprietary server running internal to my organization. We are using HiveMQ and I have created a simple plugin based on the incredibly useful documentation over at the HiveMQ website.

I have also reviewed the Caching and Non-Blocking philosophy so understand I need to take those into consideration when writing my plugin code.

Our RESTful API has implemented the Spring Security Remember-Me Auth and our HiveMQ plugin will use the 'valid' response to provide user Auth in HiveMQ.

My question is are there any recommended Java RESTful clients that interface with HiveMQ best? Obviously I've searched around and know there are various options. I'm hoping someone with more experience with HiveMQ can provide insight as to what has/hasn't worked better/worse than others.

Cheers!

Foi útil?

Solução

In theory, all of the HTTP clients for Java should work in an authentication plugin. I know of Apache HTTPClient and Netty that they work perfectly for such tasks. I've created an example plugin on Github to show a proof of concept with Apache HTTPClient. Although the API is a bit clumsy, HTTPClient is rock solid (and threadsafe!).

As you already stated, proper caching is very important when you want to scale with the mechanism. Blocking is not a problem in the AuthenticationCallback, because HiveMQ needs to wait for the answer of the server which provides the restful API. I personally would use a small timeout, though.

I hope this helps for getting you started with the REST authentication. For more in-depth discussions about that topic, there is also a HiveMQ Google Group.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top