use of org.talend.esb.sam.agent.flowidprocessor.FlowIdProducerIn in project tesb-rt-se by Talend.
the class EventFeatureImpl method initializeProvider.
/* (non-Javadoc)
* @see org.apache.cxf.feature.AbstractFeature#initializeProvider(org.apache.cxf.interceptor.InterceptorProvider, org.apache.cxf.Bus)
*/
@Override
protected void initializeProvider(InterceptorProvider provider, Bus bus) {
super.initializeProvider(provider, bus);
FlowIdProducerIn<Message> flowIdProducerIn = new FlowIdProducerIn<Message>();
provider.getInInterceptors().add(flowIdProducerIn);
provider.getInFaultInterceptors().add(flowIdProducerIn);
FlowIdProducerOut<Message> flowIdProducerOut = new FlowIdProducerOut<Message>();
provider.getOutInterceptors().add(flowIdProducerOut);
provider.getOutFaultInterceptors().add(flowIdProducerOut);
WireTapIn wireTapIn = new WireTapIn(logMessageContent);
provider.getInInterceptors().add(wireTapIn);
provider.getInInterceptors().add(epi);
provider.getInFaultInterceptors().add(epi);
WireTapOut wireTapOut = new WireTapOut(epi, logMessageContent);
provider.getOutInterceptors().add(wireTapOut);
provider.getOutFaultInterceptors().add(wireTapOut);
}
use of org.talend.esb.sam.agent.flowidprocessor.FlowIdProducerIn in project tesb-rt-se by Talend.
the class FlowIdProducerTest method flowIdProducerIn2Test.
@Test
public void flowIdProducerIn2Test() {
FlowIdProducerIn<Message> flowIdProducerIn = new FlowIdProducerIn<Message>();
Message message = new MessageImpl();
Exchange exchange = new ExchangeImpl();
message.setExchange(exchange);
String flowId = FlowIdHelper.getFlowId(message);
Assert.assertNull("FlowId should be null before FlowIdProducerIn handleMessage()", flowId);
Map<String, List<String>> headers = new HashMap<String, List<String>>();
headers.put("flowid", Arrays.asList("flowid"));
message.put(Message.PROTOCOL_HEADERS, headers);
flowIdProducerIn.handleMessage(message);
flowId = FlowIdHelper.getFlowId(message);
Assert.assertNotNull("FlowId should not be null after FlowIdProducerIn handleMessage()", flowId);
}
use of org.talend.esb.sam.agent.flowidprocessor.FlowIdProducerIn in project tesb-rt-se by Talend.
the class FlowIdProducerTest method flowIdProducerInTest.
@Test
public void flowIdProducerInTest() {
FlowIdProducerIn<Message> flowIdProducerIn = new FlowIdProducerIn<Message>();
Message message = new MessageImpl();
Exchange exchange = new ExchangeImpl();
message.setExchange(exchange);
String flowId = FlowIdHelper.getFlowId(message);
Assert.assertNull("FlowId should be null before FlowIdProducerIn handleMessage()", flowId);
flowIdProducerIn.handleMessage(message);
flowId = FlowIdHelper.getFlowId(message);
Assert.assertNotNull("FlowId should not be null after FlowIdProducerIn handleMessage()", flowId);
}
Aggregations