Home » Tag Archives: RESTful Web Services (page 2)

Tag Archives: RESTful Web Services

Configure Couchbase Docker Container using REST API

docker-logo

Couchbase Docker image is published at hub.docker.com/_/couchbase. The easiest way to start this image is: docker run -d -p 8091:8091 couchbase/server 8091 is the network port used by Couchbase Web Console for REST traffic. Complete set of ports are documented at Couchbase Network Configuration. This image can be configured using Single Host Single Container configuration as explained at hub.docker.com/_/couchbase. This blog will show you can ...

Read More »

Transcending REST and RPC

software-development-2-logo

It seems that a new paradigm is coming. Facebook and Netflix have come up with different implementations for that idea. Some people are calling it Demand-Driven Architecture, but before I show you some solutions, let’s go over some history to understand the problem. I will use the example that Netflix provides, but I think that most of us will find ...

Read More »

Getting started with Spark: it is possible to create lightweight RESTful application also in Java

apache-spark-logo

Recently I have been writing a RESTful service using Spark, a web framework for Java (which is not related to Apache Spark). When we planned to write this I was ready to the unavoidable Javaesque avalanche of interfaces, boilerplate code and deep hierarchies. I was very surprised to find out that an alternative world exists also for the developers confined to Java. In this ...

Read More »

RESTful considered harmful

software-development-2-logo

I don’t like RESTful principles and APIs. In recent years it is seen as universal protocol for inter-process communication, especially in distributed systems. However I see many deficiencies of REST and there are alternatives that work well for certain use cases. Obviously there is no one size fits all, I just want to emphasize that REST architecture is flawed in ...

Read More »

How To Stream/Serialize JPA Result As JAX-RS Response For Large Data

java-interview-questions-answers

There are times that retrieving a large data set through JPA is necessary (e.g. more than 1,000,000 records) and having them stuffed into a single instance of java.util.List is just risky (memory barrier). So, here’s a quick solution of how a JAX-RS REST resource end-point could still give us a timely Response without breaking the memory constrain through streaming or ...

Read More »

Java REST JAX-RS 2.0 – How To Handle Date, Time and Timestamp Data Types

java-interview-questions-answers

Be it X-Form-Urlencoded or JSON HTTP post to a REST resource end-point, there is no specific “data type” for date or time related data. Most developers will have these data posted as “String” or just simply convert them to Unix timestamp value (e.g. 1435061152). But, as developers implement more and more end-point methods, codes to parse of date, time and ...

Read More »

How to Keep REST API Credentials Secure

software-development-2-logo

If you are building mobile apps then you are connecting to some REST API. For example, if you want to resolve an address to a latitude/longitude information to display on a map, you might use the Google Geocoding API: https://maps.googleapis.com/maps/api/geocode/json?address=San Francisco,CA&key=AIzaSyDvFMYGjeR02RH If you are invoking the API from the client, then the API key also has to be present on ...

Read More »

RESTful Error Handling with Spring

spring-interview-questions-answers

This post will illustrate a way in which exception handling can be implemented for RESTful web services in Spring in such a manner that the exception handling concerns are separated from the application logic. Taking advantage of the @ControllerAdvice annotation we are able to create a global helper class for all controllers. By adding methods that we annotate with both ...

Read More »

Jersey WebResource – Header don’t get appended

Jersey-logo

Yesterday I ran into a strange problem when using the Jersey WebResource class for doing HTTP calls: it seemed as if the headers I set, simply got ignored when executing the HTTP call. Read ahead. What I tried to achieve was to call a REST Api to get some data from on of our applications. For doing so, I used ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns