Apache Camel: Difference between revisions
Jump to navigation
Jump to search
Line 74: | Line 74: | ||
* [https://camel.apache.org/manual/latest/using-propertyplaceholder.html Apache Camel Property Placeholders] | * [https://camel.apache.org/manual/latest/using-propertyplaceholder.html Apache Camel Property Placeholders] | ||
* [https://camel.apache.org/manual/latest/spring-remoting.html Apache Camel Spring Remoting] | * [https://camel.apache.org/manual/latest/spring-remoting.html Apache Camel Spring Remoting] | ||
* [https://camel.apache.org/components/3.18.x/crypto-component.html Apache Camel Crypto (JCE)] | |||
* [https://camel.apache.org/components/latest/mybatis-component.html Apache Camel MyBatis] | * [https://camel.apache.org/components/latest/mybatis-component.html Apache Camel MyBatis] | ||
* [https://camel.apache.org/components/latest/mvel-component.html Apache Camel MVEL] | * [https://camel.apache.org/components/latest/mvel-component.html Apache Camel MVEL] | ||
Line 82: | Line 83: | ||
* [https://camel.apache.org/components/latest/ssh-component.html Apache Camel SSH] | * [https://camel.apache.org/components/latest/ssh-component.html Apache Camel SSH] | ||
| valign="top" | | |||
* [https://camel.apache.org/components/3.18.x/others/jasypt.html Apache Camel Jasypt] | |||
* [[Jasypt]] | |||
* [[Redis]] | |||
|} | |} |
Revision as of 20:13, 28 August 2022
Route
package org.chorke.academia.java.mllp.engine.route;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.spring.SpringRouteBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.chorke.academia.java.mllp.engine.beans.listener.LabScheduleListener;
@Component
public class ScheduleRoute extends SpringRouteBuilder {
private static final Logger LOG = LoggerFactory.getLogger(ScheduleRoute.class);
@Autowired
LabScheduleListener scheduleListener;
@Override
public void configure() throws Exception {
from("quartz2://lab/hl7v2/client/schedule?cron=*/1+*+*+*+*+?&trigger.timeZone=+8 UTC").routeId("labScheduleRoute")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
LOG.debug("Keep your exchange business here");
}
})
.threads(1, 10).multicast()
.bean(this.scheduleListener).log("lab/hl7v2/client/schedule");
}
}
Handler
package org.chorke.academia.java.mllp.engine.beans.listener;
import org.apache.camel.Exchange;
import org.apache.camel.ExchangeException;
import org.apache.camel.Handler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Component
public class LabScheduleListenerImpl implements LabScheduleListener {
private static final Logger LOG = LoggerFactory.getLogger(LabScheduleListenerImpl.class);
@Handler
@Override
public void listen(@ExchangeException Exception exception, Exchange exchange) throws Exception {
LOG.info("Keep your LAB schedule business here");
}
}