Home » Tag Archives: RESTful Web Services

Tag Archives: RESTful Web Services

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 »

Automated testing of REST-services

junit-logo

Despite I’m a Java and Scala developer I still passioned a lot in testing of software. If to be more precisely – web applications. It’s really interesting to develop web app and be confident that the apps have a good quality. When I’ve started a career the most popular web architecture was MVC (Model View Control) and there was pretty ...

Read More »

Building a rest api with spray

akka-logo

Building a rest api with akka and spray is easy. This is how I did it: SprayApiApp:                   import akka.actor.{ActorSystem, Props} import akka.io.IO import akka.pattern.ask import akka.util.Timeout import spray.can.Http import scala.concurrent.duration._ object SprayApiApp extends App { //we need an ActorSystem to host our application in implicit val system = ActorSystem("SprayApiApp") //create apiActor ...

Read More »

Improving performance: non-blocking processing of streams

spring-interview-questions-answers

1. Introduction Imagine we have an application that needs to access an external web service in order to gather information about clients and then process it. More specifically, we can’t get all this information in a single invocation. If we want to look up different clients, we will need several invocations. As shown in the graphic below, the example application ...

Read More »

Creating Web Services and a Rest Server with JAX-RS and Jetty

java-interview-questions-answers

Creating a WebService in Java is remarkably easy. To add it to a ServletContainer and deploy it to an embedded WebServer is only a few more lines of code. Let’s create a simple calculator with a couple of functions as an example of a WebService. The calculator will compute the squareRoot and square of any number.  It will return a ...

Read More »

Delta Architectures: Unifying the Lambda Architecture and leveraging Storm from Hadoop/REST

apache-hadoop-logo

Recently, I’ve been asked by a bunch of people to go into more detail on the Druid/Storm integration that I wrote for our book: Storm Blueprints for Distributed Real-time Computation.  Druid is great. Storm is great. And the two together appear to solve the real-time dimensional query/aggregations problem. In fact, it looks like people are taking it mainstream, calling it ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close