codecentric

Android persistence accelerated – revisited

Finally, after quite a while, we found some free time to work on Android persistence library I wrote about in this blog post. Knowing we have very tight schedule, as always, we wanted to make sure library is ready to be used. So, we took a good look at what we did before, rolled up our sleaves and got to work.
Main goal was to make library stable and useful. In order to achieve that, some of the functionalities were reimplemented, some new were added and some were removed. There is no sense in having some features that are not part of any complete logic representing only fractions of future functionality set. Since those are useless if looked upon separately, they could only confuse person who is using the library.

(read more…)

Dusan Zamurovic

 

Writing lightweight REST integration tests with the Jersey Test Framework

Writing REST services with JAX-RS (and its reference implementation Jersey) is easy. A class annotated with @Path and some methods with @GET, @POST, … annotations is enough for a fully functional REST service. Real world applications however are more complex. There are request-filters for authorization and access control, context providers for injecting data-access-objects, mappers that convert exceptions to appropriate HTTP responses, MessageBodyReaders and -Writers to convert JSON and XML to and from Java objects, and so on.
(read more…)

Michael Lex

 

Spring Data – Part 6: Redis

Redis

Redis [1] is a NoSQL [2] key/value datastore. Think of it as a big, very fast persistent hashmap. Redis offers a master/slave data replication [3] and also a built-in publish/subscribe messaging system [4].

It is implemented in C and can be built on your favourite platform. Just grab the tar from the download page [5] or use the precompiled binaries for Windows [6] (that’s what I did).

After compiling or downloading, open a shell in your Redis folder an start the server by typing:

C:\dev\bin\redis64>redis-server ./redis.conf
[5612] 09 Mar 10:34:15 * Server started, Redis version 2.4.5
[5612] 09 Mar 10:34:15 * DB loaded from disk: 0 seconds
[5612] 09 Mar 10:34:15 * The server is now ready to accept connections on port 6379
[5612] 09 Mar 10:34:16 - DB 0: 1 keys (0 volatile) in 4 slots HT.

Open another shell and start the Redis client by typing:

C:\dev\bin\redis64>redis-cli
redis 127.0.0.1:6379> ping
PONG
redis 127.0.0.1:6379> SET foo bar
OK
redis 127.0.0.1:6379> GET foo
"bar"

We ping the server and set and lookup a string based key/value pair.

Publish/Subscribe

Now let’s have a look at the publish/subscribe messaging. Type:
(read more…)

Tobias Trelle