here is some of my route:

from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
        .onException(Exception.class).process(new LogError("")).end()
        .bean(AddIpBean.class) 
        .bean(SetRoutingKey.class)
        .bean(Util.class, "setMiljo")
        .multicast()
        .to("direct:channel1", "direct:channel2","direct:channel3")
        .aggregationStrategy(new HubAggregationStrategy())
        .stopOnException();
    
         from("direct:channel1")
        .onException(Exception.class).process(new LogError("MQFAIL")).end()
        .setHeader(HubConstants.LOGSTATE.getValue(),
constant(HubConstants.MQSTART.getValue()))
        .bean(Mq.class, "mqHeaders")
        .bean(Mq.class, "logStart")
        .choice()
        .when(header(HubConstants.MILJO.getValue()).contains("U"))
        .inOnly("activemqU:topic:HUB_TOP01")
        .when(header(HubConstants.MILJO.getValue()).contains("T"))
        .inOnly("activemqT:topic:HUB_TOP01")
         .when(header(HubConstants.MILJO.getValue()).contains("S"))
        .inOnly("activemqS:topic:HUB_TOP01")
         .when(header(HubConstants.MILJO.getValue()).contains("P"))
        .inOnly("activemqP:topic:HUB_TOP01");


I have create an error so the ("activemqU:topic:HUB_TOP01") throws an
exception, the MQ i down.


.onException i go to LogError class, and what i want to get back to the
client is a soapfoult only with the message "MQFAIL"


But how...

I trien tryed to do some code that change the exchange:


        exchange.setException(null);
        
        
        Message out = exchange.getOut();  
        out.setBody("MQFAIL");     
        out.setHeader(org.apache.cxf.message.Message.RESPONSE_CODE, new
Integer(500));


        but the client get this message back:

        Sequential processing failed for number 0. Exchange[Message: MQFAIL].
Caused by: [org.springframework.jms.UncategorizedJmsException -
Uncategorized exception occured during JMS      processing; nested exception is
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ0018: Failed to connect
to queue manager 'HUB_FEJL_416' with connection mode 'Client' and host  name
'bdaix416.bdunet.dk'. Check the queue manager is started and if running in
client mode, check there is a listener running. Please see the linked
exception for more      information.; nested exception is
com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode
'2' ('MQ



Frank 



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-do-i-control-my-soap-foult-back-to-the-client-tp5755111.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to