camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zappee <arnold.somo...@gmail.com>
Subject Re: camel rest route
Date Tue, 23 Feb 2016 16:23:46 GMT
Hi,

Thx for the reply.

Now I am facing with another strange behavior. I want to fill in my user
object with random generated data, like this:

@Override 
public void configure() throws Exception { 
    User user = new User(); 
    user.setFirstName(*Generator.randomFirstName()*);
    user.setLastName(*Generator.randomLastName()*);
    *user.setBirthday(new Date());*

    restConfiguration().component(*"restlet"*) 
    *.host("localhost").port(8081)* 
            .bindingMode(RestBindingMode.json) 
            .dataFormatProperty("prettyPrint", "true"); 
 
    rest("/user") 
            .description("user rest service") 
            .produces(APPLICATION_JSON_UTF_8) 
            .get("/hello")
.outType(User.class).route().routeId("GET@/generate").transform().constant(user).endRest();

}


But I always get the same values in all fields. For example the birthday
field is fill in with the current timestamp value during the first rest call
and same value is displayed later in the next calls:

First response:
{
"id": null,
"email": null,
"firstName": "Lindsey",
"lastName": "Craft",
"birthday": 1456243732376
}

I get the exactly same response if i call my rest in the next 5 mins. How it
is possible?





--
View this message in context: http://camel.465427.n5.nabble.com/camel-rest-route-tp5777992p5778136.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message