use of com.adaptris.core.interceptor.InFlightWorkflowInterceptor in project interlok by adaptris.
the class WorkflowManager method configureMessageCounter.
private void configureMessageCounter() throws CoreException, MalformedObjectNameException {
if (managedWorkflow.disableMessageCount())
return;
if (!hasInterceptorOfType(managedWorkflow.getInterceptors(), MessageMetricsInterceptor.class)) {
log.trace("Message count interceptor added for [{}], tracks metrics for ~1hr", createObjectName());
String uid = managedWorkflow.getUniqueId() + MessageMetricsInterceptor.UID_SUFFIX;
managedWorkflow.getInterceptors().add(new MessageMetricsInterceptor(uid, new TimeInterval(5L, TimeUnit.MINUTES), 12));
}
if (!hasInterceptorOfType(managedWorkflow.getInterceptors(), InFlightWorkflowInterceptor.class)) {
log.trace("InFlight interceptor added for [{}]", createObjectName());
String uid = managedWorkflow.getUniqueId() + InFlightWorkflowInterceptor.UID_SUFFIX;
managedWorkflow.getInterceptors().add(new InFlightWorkflowInterceptor(uid));
}
}
use of com.adaptris.core.interceptor.InFlightWorkflowInterceptor in project interlok by adaptris.
the class MessagesInFlightTest method buildAdapter.
private Adapter buildAdapter(PoolingWorkflow workflow) throws Exception {
Adapter adapter = createAdapter(getName());
Channel channel = new Channel(getName());
workflow.setPoolSize(1);
workflow.setShutdownWaitTime(new TimeInterval(1L, TimeUnit.SECONDS));
workflow.addInterceptor(new InFlightWorkflowInterceptor(getName()));
workflow.getServiceCollection().add(new WaitService(new TimeInterval(5L, TimeUnit.SECONDS)));
channel.getWorkflowList().add(workflow);
adapter.getChannelList().add(channel);
return adapter;
}
Aggregations