RESTful v/s MQ. Differences and other key features apart from Guaranteed Delivery

One of the biggest differences is that REST implies synchronous processing while MQ is more often asynchronous. As you already mentioned, MQ is a way to decouple producer and consumer so that they don’t have to be online at the same time but the system would still be functioning as a whole. If your use … Read more

Change the array/collection order using a REST API

Following the REST Uniform Interface constraint, the HTTP PUT and PATCH methods have to stick to the standard semantics, so you can do that with either one in the following way: With PUT, clients can upload a whole new representation with the order they want. They will request GET /api/v1/items, change the order as they … Read more

Open API vs. REST API – difference

REST (REpresentational State Transfer) describes a way how a clients and servers interact with each other. REST communication typically bases on HTTP protocol (but that isn’t a requirement) and requests are made to a resource URI, possibly containing additional request data, and replies can be anything: HTML, XML, JSON, CSV, plain-text or even raw binary … Read more

QueryParam binding with enum in jersey

From the Javadoc, the @QueryParam annotated type must either: Be a primitive type Have a constructor that accepts a single String argument Have a static method named valueOf or fromString that accepts a single String argument (see, for example, Integer.valueOf(String)) Be List<T>, Set<T> or SortedSet<T>, where T satisfies 2 or 3 above. The resulting collection … Read more

Spring RestTemplate invoking webservice with errors and analyze status code

You need to implement ResponseErrorHandler in order to intercept response code, body, and header when you get non-2xx response codes from the service using rest template. Copy all the information you need, attach it to your custom exception and throw it so that you can catch it in your test. public class CustomResponseErrorHandler implements ResponseErrorHandler … Read more

Jersey Grizzly REST service not visible outside localhost

To make a server IP adress visible outside of localhost, you must fist open the neccessary firewall ports(if you have one), or use “0.0.0.0” instead of “localhost” in order for the server to listen to all IP addresses and network adapters. Before testing it in your local network, try pinging your server device from your … Read more