 Hello, everyone. My name is Selen Singh. I work as a maintenance engineer at Red Hat. Today, I'm going to present a talk on integration, enterprise integration pattern using Apache Camel. So any of you aware of Apache Camel? Okay. So let's see what will be the agenda. We'll see what is Apache Camel, what is EIP, architecture, and few examples with demo. So Apache Camel is a powerful open source integration framework based on integration enterprise pattern. So what is the integration framework? Like you have a system which works on different technology. It has a different messaging format. You have some other system, and you want to integrate both the system. So why the integration? Because it's critical for the business. And why you go for a framework? So the main advantage for the framework is like it does a heavy lifting for you. You only focus on your business requirement. So you can use Apache Camel to integrate a two different system and two different technologies having a different messaging format. Let's see what is enterprise integration pattern. So EIPs are the tested solution for the design problem encountered for many years in development. It's the most important, it's technology-independent design guidance. So it provides you the guidance to use to solve a design problem or to solve an integration problem independent of the technology you are using or any of the architecture. So it helps, you can say, a developer or architecture to describe and develop a robust integration solution. Okay, so we have a book with the same title. On the right-hand side you can see a book. We know this book as a Bible for integration design. So this book was written in like past 2003. So the author of this book, Greg Hoppe and Bobby Wolf were a consultant. So they went out at the client and they provided an integration solution for their problems. And what they observed like going forward, the same problem occur again and again. So what they started, they started taking notes for the problem and the solution which they provided to the customer. And after a long period of time, this notes converted into this books. So it has almost 65 integration patterns. And in short, what we can say is like Apache Camel is a software for this book. So Apache Camel implements almost all the integration pattern which has been defined. So these are the few and the mostly used integration patterns like content-based router, message filter, some of this pattern we'll see in the coming slides. So let's see the content-based router. So I have an order and depending upon the content of the order, I will redirect it to the visit inventory or to the gadget inventory. So if try to write in a simple language, so from new order, then there will be a choice. When is visit, go to the visit, otherwise to gadget. I just added a curly braces and let's define what's the new order. So new order I'm defining an endpoint to accept the order from active MQ. It can be any endpoint. And let's define a predicate which will see the product, the order which will scan the order depending on the on the X path. The product will be visit. It will send to the visit. And this visit and gadget, we define these two endpoints. And both are the active MQ. So if you are familiar with Java, it will look like a Java code. So Java code should have a method, configure, and should have a class. So the class, route builder, that is the starting point for a camel route. You need to implement the configure method to write your code. So the last four line, if you can see, this four line does the heavy business, does all the business requirement. There is no level of, no low level of code. All this has been handled by a camel framework. So I can write this code by using camel. I can compile and execute this code. So further, I can just define the endpoint in the route itself. So further, I can optimize the code and it will increase your readability. So if I take this code to a non-developer, he or she at least will have an idea of what we are trying to achieve. So if you are not familiar with Java, camel also provides XML DSL. You can write the same code in an XML. And let's see how. Right now I am using an active MQ to consume my messages. Instead of active MQ, I want to read from any other endpoint or any other system. So it's very simple. You just need to update the URI. So right now I am reading the message from a file. So it's how simple you can customize all your code. So let's see. This is the very high level of camel architecture. So inside the camel code, you can write a multiple routes using this integration pattern. You can define an integration pattern. And these are the component, component which will connect to the outside of the world. So right now, component are GMS component, STTP component. If you want to connect with the STTP client, if you have a file component, so camel has 290 plus component. So I have not listed all the component. You name the component. Definitely the camel will have an integration component for that system. And running a camel, freedom to choose any container. You can run camel in a standalone. You can run camel in a spring boot. Any applications over, so JEE application or web application, we can reuse a camel to run anywhere. So let's see some EIP with how it has been implemented with camel. So we just saw content-based router. Let's see the recipient list. So in recipient list, the same message is sent to the multiple consumer or you can say a multiple recipient channel. So if you take a real-time scenario, when we withdraw cash from an ATM, the same message is sent to you in terms of SMS or email. The same message will be, will send to the bank from where the transaction has been done. So you can use recipient list to send a same message to the multiple recipient. So this can be done by using a multicast or by using a recipient list. Now the splitter EIP. So what does the splitter EIP says? If you have an order and you want to split your order in a multiple form, depending upon your requirement. So if I take a simple example, when you go on an online shopping portal, we create our shopping cart and while doing our payment and while submitting the shopping cart, the shopping cart converts into multiple order depending upon the supplier. So the same way the splitter works, your order, you can split your order depending upon your business requirement. So single shopping cart converted into the multiple orders. So we saw the splitter, the opposite of splitter like aggregator. If you have multiple orders, you can aggregate your orders depending upon the requirement. So for this example I am using an aggregate. You need to use aggregate. You need to provide on which you need to aggregate your order. And this is a timeout, batch timeout like it will wait for like 5 minutes and till 5 minutes, all the order which has been received will be combined together and will be sent to some other endpoint. So same way as pipes and filter. So what does the pipes and filter says? Like you execute your order in a sequential. It goes step by step. So if you are writing your route, you just need to define the pipeline. But in camel, the sequential order is by default. So you don't need to mention the pipeline. If you mention your route by default, it's assumed it's going to execute your code step by step. Now it's a message translator. Like you received some message and you want to transform that message or you want to update the message before sending to some other system or sending to some other environment. So camel support translator using processor, bean or transform nodes. So on the right side, I have defined a processor. So this is my route which is starting from a direct component. And I'm doing a process and I have written a class. So to write a processor, you need to write a plot which will implement a processor. So when you implement your processor, you need to override your process method which will give you exchange and you can do in your Java code, you can modify the message inside the process method. Now the message filter. So you receive a number of multiple message and you want to filter it out a message. Like if I want only the message sent to the endpoint which has a visit code, you can use the filter. You can use the filter on the header. You can use the filter on the body. Now the re-sequencer. The re-sequencer what it does, it receives a multiple order at a time and it will arrange your order in your some sequence. By default, it uses a string.toCompare. You can write, you can implement and you can write your own sequencer on which you want your message to be sequenced. And wire type, this is the most used, you can say, EIP pattern. The wire type, what it does, you have a message. You received a message and you want the copy of that message to be saved somewhere else without any process. You can use a wire type. So what it does, it will send the same message to the wire type and also it will send the message for the further processing. So let's see a demo. So what I'm trying to display in a demo is like, I have a system which works on an XML. I have other system which works on a messaging queue. So it accept a messages from a queue. The other system, it deals with the XML format. You will see my order ID. My order ID will be a queue name in other environment. My messages, the customer which has the messages will be, that message will be present in that queue. So if I see this XML, the customer with ID A0001 has two messages, message 1 and message 2. So these are the two format which the two different system is used. Let's see how camel will read the file and do. So I have divided my camel into three routes basically. So this will be my main route. The EIP pattern, if you can see, I am using wire tab. So I'm using wire tab to pass my file which I will be receiving in XML format to archive the file. So this will, the wire tab will have the same message sent to this wire tab route and it will just archive the file to some other directory. Now I'm sending my message, the same message to a splitter. So I'm using a splitter which will split my message depending upon the customer ID. And depending upon the customer ID and that message will be sent to a multiple recipient because the queue, the queue will be different, the queue will be depending upon the customer ID. So I'm also using a recipient list. So this is my order which I just explained by customer. So I have written this code on the ID Eclipse by using XML. So I'm using an active MQ for the integration. So right now you can see these are the default queues provided. So there is no other queues based on the customer ID. So this is my route. So the main route, I am accepting a file from my input directory. Then it's just a log. And then the wire tab, what I'm doing, wire type is called archive. So I'm archiving the file. So I'm sending the same file to a archive directory. And after the wire type, it's called the split. Now my splitter route will be executed. So this code will be executed the split. The code inside the split will be executed every time depending upon the number of order which we have received. Now I'm taking the header with the queue name. So I'm creating a header queue name which will have my ID because the customer ID will be a queue. And the message, I'm reading the message text will be that message. So I have sent the header queue name. I have sent the queue name. I have sent the message body. Now I'm sending this to the jms component I'm using. I'm sending the queue header.queue name. And my queue name will be depending upon the customer name, customer ID. And it will log a message like, okay, the execution has been completed. And once done, the final route will be processed. So I'm just running as a standalone. So you can see all the total three routes of which three has been started. So my camel route has been started successfully. So I'm deleting the archive file because I... So I'm placing a file from a sample file. Placing a file order.xml inside the input directory. And as soon as I place, my route got executed, archiving the order.xml. In the archive directory, you can see the same xml file has been archived. Okay? Now I want to see my messaging whether my ActiveM queue has received, has created a queue and received all those messages. So my input directory will be empty because the file has been processed. Now you can see a queue, different queue has been created with the customer ID and it has the messages. So that's two messages were there for A0001 customer. And if you want, we can see the message contained. So this all two messages has been sent to the queue A001. So what I'm trying to explain is this is the route. If you can see, it will hardly be a 30 to 40 lines of code which I wrote to integrate a two system, two different system talking in xml to the messaging and all the low level code taken care by the camel itself. So the heavy lifting has been done by the camel. So I think that's all is there. So these are the some references. So that's all from my side if you have any question. So if I reframe your question, how feasible is camel to integrate with AWS, you were talking about. Yes, camel has a component AWS. So instead of I use the component activeMQ, you can use the AWS. You can pass all those parameter and configuration and you can integrate the camel with AWS. Any other question? Okay, thank you guys. So, it's all done.