Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Devoxx MA - Connecting disparate systems in a l...

Devoxx MA - Connecting disparate systems in a lightweight way

Have you ever struggled with connecting systems that were not designed to communicate with each other? This is a common challenge faced by many microservices architectures today. In this talk, we’ll explore some of the tools and approaches that can help you break down these silos and integrate your microservices with external systems seamlessly, allowing for faster development cycles and more efficient integration.

We’ll start by introducing Apache Camel, a powerful tool that offers over 300 connectors to transfer data between a wide variety of systems. With its rich set of routing, filtering, and transformation capabilities, Camel is a versatile system integration tool that can help you integrate your systems more efficiently.

Next, we’ll dive into developing a Java application that can seamlessly connect various systems using Apache Camel. With just a few lines of code, we can utilize the power of Camel to transform and transfer data between different systems. Furthermore, we’ll explore how Camel JBang and Quarkus can greatly improve the developer experience.

By the end of this talk, you’ll have the tools and knowledge to connect your Java microservices with external systems faster and more efficiently.

Zineb Bendhiba

October 10, 2024
Tweet

More Decks by Zineb Bendhiba

Other Decks in Programming

Transcript

  1. Zineb Bendhiba • Senior Software Engineer at Red Hat •

    Apache Camel PMC • International Speaker • 15+ years professional software development experience • Speak English, French, Moroccan Darija, Arabic • Cadi Ayyad University Alumn • https://zinebbendhiba.com
  2. Apache Camel: Camel message Routing Term Meaning Message data transferred

    by a Route Exchange envelope; wraps the data Endpoint a channel, receiver or sender Component know-how; creates endpoints Processor Java API; custom logic
  3. Using Processor from("activemq:myQueue") .process(new Processor() { public void process(Exchange exchange)

    throws Exception{ String payload = exchange.getIn().getBody(String.class); // do something with the payload and/or exchange here exchange.getIn().setBody("Changed body"); } }) .to("activemq:myOtherQueue");
  4. Using Beans from("activemq:myQueue") .process(new Processor() { public void process(Exchange exchange)

    throws Exception{ String payload = exchange.getIn().getBody(String.class); // do something with the payload and/or exchange here exchange.getIn().setBody("Changed body"); } }) .to("activemq:myOtherQueue");
  5. Using Bean package com.foo; public class MyBean { public String

    saySomething(String input){ return "Hello " + input; } } from("direct:hello") .to("bean:com.foo.MyBean");
  6. Logging • Logging Components • Log EIP • Customizing logs

    and format • Masking sensitive information from("activemq:orders") .to("log:com.mycompany.order?level=DEBUG&groupSize=10") .to("bean:processOrder"); from("direct:start") .log("Processing ${id}") .to("bean:foo");
  7. Error Handler: Dead Letter Queue from("direct:start") .to("direct:invalidEndpoint"); // This will

    trigger an error // Configure the Dead Letter Channel (DLC) to handle errors errorHandler(deadLetterChannel("direct:errorQueue") .maximumRedeliveries(3) // Maximum number of redelivery attempts .redeliveryDelay(1000) // Delay between redelivery attempts .logExhausted(true) // Log if redelivery attempts are exhausted ); // Define the DLC route to handle failed messages from("direct:errorQueue") …;