camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kaiser75 <>
Subject Re: Java Rest DSL Spring boot and Rabbitmq
Date Thu, 18 May 2017 15:52:41 GMT
thanks souciance.  Here is my code , my question is how do I rteurn  a custom message when
the request is successful. Currently for some reason, my code returns the transformed payload
along with 200 ok, I want to send a custom message something like { statuscode = 200, message="success"}
as a response 

public void configure() throws Exception { 

                        // errorHandler(deadLetterChannel("jms:queue:dead")); 


                        rest("/ewarehouse").description("Adjustments REST service").produces("application/json") 

                       .bean(new ValidateEWAdjustments()) 
                       .bean(new EWAdjustmentsBean()) 
                        .bean(new JsonSerializerBean()).split().jsonpath("$.*").parallelProcessing() 
                        .bean(new JsonSerializerBean()) 


currently im returning the output from ".bean(new EWAdjustmentsBean()).bean(new JsonSerializerBean())" 

On Sunday, May 14, 2017, 10:00:14 AM EDT, souciance [via Camel] <>
wrote: Have a look at the camel-rabbitmq component, there are some parameters for pooling
but I haven't used them myself. Maybe the unit tests provide more information.
I believe .to("rabbitmq...") opens and closes a new connection.
For json schema validation there are various frameworks you can use to use in your code. One
is a bean, validate your json, throw
an error if it fails or continue processing.
|  | Virusfritt.  |

On Sat, May 13, 2017 at 6:58 PM, kaiser75 [via Camel] <[hidden email]> wrote:

 I've a use case where I need to expose a rest end point to receive a request, validate it
and then post it to a Rabbitmq queue. 

I'm thinking of using Java Rest DSL , spring boot components to build this service out. I
do have a few questions, 

How do I enable connection pooling for my connections to Rabbit? 

Does  to("rabbitmq://localhost: 5672/ex2")   open and close a new connection every time
it is invoked?

how do I add json schema validation to validate inbound requests ?

Thanks much

I'm planning to model my code after the spirng-boot-rest-jpa sample in the camel examples

   If you reply to this email, your message will be added to the discussion below: http://camel.465427.n5.nabble.
com/Java-Rest-DSL-Spring-boot- and-Rabbitmq-tp5799453.html   To start a new topic under Camel
- Users, email [hidden email] 
 To unsubscribe from Camel - Users, click here.

   If you reply to this email, your message will be added to the discussion below:
  To unsubscribe from Java Rest DSL Spring boot and Rabbitmq, click here.

View this message in context:
Sent from the Camel - Users mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message