Search in sources :

Example 16 with ExchangePattern

use of org.apache.camel.ExchangePattern in project camel by apache.

the class AvroEndpoint method createExchange.

public Exchange createExchange(Protocol.Message message, Object request) {
    ExchangePattern pattern = ExchangePattern.InOut;
    if (message.getResponse().equals(Schema.Type.NULL)) {
        pattern = ExchangePattern.InOnly;
    }
    Exchange exchange = createExchange(pattern);
    exchange.getIn().setBody(request);
    exchange.getIn().setHeader(AvroConstants.AVRO_MESSAGE_NAME, message.getName());
    return exchange;
}
Also used : Exchange(org.apache.camel.Exchange) ExchangePattern(org.apache.camel.ExchangePattern)

Aggregations

ExchangePattern (org.apache.camel.ExchangePattern)16 Exchange (org.apache.camel.Exchange)8 AsyncCallback (org.apache.camel.AsyncCallback)4 AsyncProcessor (org.apache.camel.AsyncProcessor)4 Endpoint (org.apache.camel.Endpoint)4 Producer (org.apache.camel.Producer)4 AsyncProducerCallback (org.apache.camel.AsyncProducerCallback)3 Method (java.lang.reflect.Method)2 DefaultExchange (org.apache.camel.impl.DefaultExchange)2 OutputStream (java.io.OutputStream)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 Principal (java.security.Principal)1 ArrayList (java.util.ArrayList)1 Subject (javax.security.auth.Subject)1 HttpHeaders (javax.ws.rs.core.HttpHeaders)1 Request (javax.ws.rs.core.Request)1 SecurityContext (javax.ws.rs.core.SecurityContext)1 UriInfo (javax.ws.rs.core.UriInfo)1