lunedì 3 giugno 2024

Apache Camel global exception handler

@Component
public class SchedRouteBuilder extends RouteBuilder {

@Override
public void configure() throws Exception {
// Define a global exception handler
onException(Exception.class)
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
Exception exception = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
exception.printStackTrace();
}
})
.handled(true);

from("direct:message-producer")
.to("paho-mqtt5:{{topicname}}?brokerUrl=tcp://{{brokeraddress}}:{{brokerport}}");
}

}

Nessun commento:

How to deploy Podman images to OpenShift Container Platform (CRC on localhost)

I have a microservice on localhost and I want to deploy its Podman image on OCP, which I am running using CRC on localhost.       1. Get the...