I need to expose some service for remote use by Java clients (they shall use httpinvoker) and other languages (they shall use REST).
Can I configure spring boot to expose both ? (I would not mind if two separate instances with different ports would be used, like in this post).
I dumped the idea of providing an API for the Java clients that internally uses REST because it is rather tedious to wire all REST endpoints into the code manually using RestTemplate.
I like the concept of HttpInvoker because a ProxyFactoryBean
gets used automagically. If Spring Remoting would be able to do this in a way it can be done for JMS, AMQP and the others I would head this way.
Spring framework supports following remoting technologies: Remote Method Invocation (RMI) Spring's HTTP invoker. Hessian.
The Spring approach to HTTP Remoting allows clients to communicate with the Spring-hosted server code via HTTP without the client code requiring any knowledge of HTTP being used. Instead, the client Java code only "sees" normal business-related Java objects (usually interfaces) rather than HTTP-specific objects.
Spring provides a special remoting strategy which allows for Java serialization via HTTP, supporting any Java interface (just like the RMI invoker). The corresponding support classes are HttpInvokerProxyFactoryBean and HttpInvokerServiceExporter. Hessian.
Spring rmi remoting example. Now we need to create one main method where we will look up the implementation interface bean from the spring context. Once we have the instance, we can now call the server-side method just like any other local java method invocation.
You can use something like this. Expose your services as a rest service. Then make your java clients to consume those services using http or some other library. If any other party is interested also, they can consume it in their own way too.
Else you can create your own jar consuming your rest services and let your java clients use that, without the knowledge about the rest service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With