In this chapter, we can apprehend the special Camel concepts. let us begin by means of taking a basic example to recognize center concepts to start with.
Each camel application can have at least one CamelContext. that is the place where we add camel routes. it is just like ApplicationContext of Spring.
Camel context can be notion as a field which continues all things together. One camel context may have multiple routes inside it.
CamelContext may also include one or more routes. Routes are the mixing logic which defines how information will flow in camel context from one endpoint to some other.
Endpoint is give up of channel via which system can send or receive messages. that is what we call as destination or source in communication language.
Components are point of extension in Camel. additives may be an interface to generation, information format, transformers, etc. they may additionally act as a factory for endpoints.
EIP stands for organization Integration sample. these are recognized and well-known solutions to a routine trouble. Camel helps most of the organization Integration patterns.
CBR patterns allow us to route information as according to the content of the input document.
This sample is used while we need to course values relying on the contents of the body of input.
The following example will read information from D:/data/input listing. After studying, it will check for value tag in the records tag. If the price tag includes value1, it will be sent to D:/value1, If it contains value2, it will be sent to D:/value2 and if none of these each, then it will be sent to others.
A splitter pattern is used to split input data into smaller chunks.
This sample is used maximum of the times with huge information input which requires to be split in chunks, so it will become method-able. It breaks down enter into smaller fragments based on input token string.
If you check AMQ you will find 3 messages posted.
A recipient listing pattern is used whilst a listing of recipient needs to be retrieved from the message body itself.
In the following example, a message may be sent to all of the recipients who are listed in the customer tag as comma separated list of strings.
Camel presents help to almost all of the EIPs recognized. a number of generally used EIP are as referred to below.
The entire list of EIP and their usage can be located at Camel’s official documentation http://camel.apache.org/eip.html
Using Error Handler − that is the easiest way to handle exceptions in camel.
To use this, we must configure mistakes handler class bean and provide it as reference to CamelContext errorHandlerRef attribute.
Camel also helps Java style try catch finally block for error handling.
Similar to Java, it has the following three blocks −
Note − Mock is testing element and not advocated for different functions. it is the factor in camel used for testing just like jMOck aspect in test driven development.
In the above example, we will provide a list of exceptions that need to be treated by the catch block.
Start Fuse using Fuse.bat/start.bat.
If you start Fuse using start.bat, use client.bat to connect to Fuse. You need to get the UI as shown inside the following screenshot.
This is the CLI for accessing Karaf and Fuse commands.
JBOSS Related Interview Questions
|J2EE Interview Questions||EJB(Enterprise JavaBeans) Interview Questions|
|IBM Websphere Application Server Interview Questions||Java EE Connector Architecture (JCA) Interview Questions|
|Soap UI Interview Questions||jBPM Interview Questions|
|Advanced Linux Interview Questions||WebLogic Administration Interview Questions|
|Apache Tomcat Interview Questions||GlassFish Interview Questions|
|Middleware Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.