August 17, 2023

cMessagingEndpoint – Docs for ESB 5.x

cMessagingEndpoint

cMessagingEndpoint_icon32_white.png

cMessagingEndpoint properties

Component Family

Messaging

Function

cMessagingEndpoint allows two
applications to communicate by either sending or receiving messages,
one endpoint can not do both.

Purpose

cMessagingEndpoint sends or
receives messages.

Basic settings

URI

URI of the messages to send or receive. It can be of different
format:

-File: “file:/”,

-Database: “jdbc:/”,

-Protocols: “ftp:/”, “http:/”

-etc.

You can add parameters to the URI using the generic URI syntax,
for example:

"file:/directoryName?option=value&option=value"

For more information on the different components that can be used
in cMessagingEndpoint, see Apache Camel’s Website: http://camel.apache.org/components.html.

Advanced settings

Dependencies

By default, the camel core supports the following components:
bean, browse, class, dataset, direct, file, language, log, mock,
properties, ref, seda, timer, vm.

To use other components, you have to provide the dependencies
corresponding to those components in the cMessagingEndpoint component. To do so:

Click the plus button to add new lines in the Camel component list. In the line added,
select the component you want to use in cMessagingEndpoint. For more information about the
commonly used Camel components, see Commonly used Camel components.

 

Use a custom component

If you want to use a custom component, select this check box and
click the three-dot button to upload a jar file with your own
component.

Note

All the transitive dependencies of this cus­tom component
should be included in the jar file.

Usage

This component can be used as sending and/or receiving message
endpoint according to its position in the Route.

Limitation

 n/a

Commonly used Camel components

The following table lists the most commonly used Camel components that can be called by
cMessagingEndpoint. Click the links in the table to
go to the Apache Camel’s Website for the latest information of the these components.
Make sure to use the information applicable for the Camel Version included in Talend ESB. See also Talend ESB
Mediation Developer Guide
for details of the Camel components.

Component / ArtifactId / URI

Description

ActiveMQ / activemq-camel

activemq:[topic:]destinationName

For JMS Messaging with Apache ActiveMQ

AHC /
camel-ahc

ahc:http[s]://hostName[:port][/resourceUri][?options]

To call external HTTP services using Async Http Client.

APNS /
camel-apns

apns:<notify|consumer>[?options]

For sending notifications to Apple iOS devices.

Avro /
camel-avro

avro:[transport]:[host]:[port][/messageName][?options]

Working with Apache
Avro
for data serialization.

Atom /
camel-atom

atom:uri

Working with Apache
Abdera
for atom integration, such as consuming an atom
feed.

Bean /
camel-core

bean:beanName[?method=someMethod]

Uses the Camel Bean Binding to bind message exchanges to beans in
the Camel Registry. Is also used for exposing and invoking POJO
(Plain Old Java Objects).

Cache /
camel-cache

cache://cachename[?options]

The cache component facilitates creation of caching endpoints and
processors using EHCache as the cache implementation.

Class /
camel-core

class:className[?method=someMethod]

Uses the Camel Bean Binding to bind message exchanges to beans in
the Camel Registry. Is also used for exposing and invoking POJOs
(Plain Old Java Objects).

CMIS /
camel-cmis

cmis://cmisServerUrl[?options]

Uses the Apache Chemistry client API to interface with CMIS
supporting CMS.

Context / camel-context

context:camelContextI localEndpointName

Used to refer to endpoints within a separate CamelContext to
provide a simple black box
composition
approach so that routes can be combined into
a CamelContext and then used as a black box component inside other
routes in other CamelContexts

CouchDB / camel-couchdb

couchdb:hostName[:port]/database[?options]

To integrate with Apache CouchDB.

Crypto (Digital Signatures) / camel-crypto

crypto:sign:name[?options],
crypto:verify:name[?options]

Used to sign and verify exchanges using the Signature Service of
the Java Cryptographic Extension.

CXF /
camel-cxf

cxf:address[?serviceClass=...]

Working with Apache
CXF
for web services integration

CXF Bean / camel-cxf

cxf:bean name

Process the exchange using a JAX WS or JAX RS annotated bean from
the registry. Requires less configuration than the above CXF
Component

CXFRS /
camel-cxf

cxfrs:address[?resourcesClasses=...]

Working with Apache
CXF
for REST services integration

Direct
/ camel-core

direct:name

Synchronous call to another endpoint from same CamelContext

Disruptor / camel-disruptor

disruptor-vm:someName[?<option>]

To provide the implementation of SEDA which
is based on disruptor.

ElasticSearch / camel-elasticsearch

elasticsearch://clusterName[?options]

Uses the Bean
Binding
to bind message exchanges to EJBs. It works like
the Bean
component but just for accessing EJBs. Supports EJB 3.0 onwards.

Spring
Event
/ camel-spring

event://default, spring-event://default

Working with Spring ApplicationEvents

Exec /
camel-exec

exec://executable[?options]

For executing system commands

Facebook / camel-facebook

facebook://endpoint[?options]

Providing access to all of the Facebook APIs accessible using
Facebook4J

File /
camel-core

file://nameOfFileOrDirectory

Sending messages to a file or polling a file or directory.

Flatpack / camel-flatpack

flatpack:[fixed|delim]:configFile

Processing fixed width or delimited files or messages using the
FlatPack
library

FOP /
camel-fop

fop:outputFormat[?options]

Renders the message into different output formats using Apache
FOP
.

FreeMarker / camel-freemarker

freemarker:someTemplateResource

Generates a response using a Freemarker template

FTP /
camel-ftp

ftp:contextPath[?options]

Sending and receiving files over FTP.

FTPS /
camel-ftp

ftps://[username@]hostName[:port]/directoryName[?options]

Sending and receiving files over FTP Secure (TLS and SSL).

Geocoder / camel-geocoder

geocoder:address|latlng:latitude,longitude>[?options]

Supports looking up geocoders for an address, or reverse lookup
geocoders from an address.

Google Guava EventBus / camel-guava-eventbus

guava-eventbus:busName[?options]

The Google Guava EventBus allows publish-subscribe-style
communication between components without requiring the components to
explicitly register with one another (and thus be aware of each
other). This component provides integration bridge between Camel and
Google Guava EventBus infrastructure.

HBase /
camel-hbase

hbase://table[?options]

For reading/writing from/to an HBase store
(Hadoop database).

HDFS /
camel-hdfs

hdfs://hostName[:port][/path][?options]

For reading/writing from/to an HDFS file system
using Hadoop 1.x.

HDFS2 /
camel-hdfs2

hdfs2://hostName[:port][/path][?options]

For reading/writing from/to an HDFS file system
using Hadoop 2.x.

HL7 /
camel-hl7

mina2:tcp://hostname[:port]

For working with the HL7 MLLP protocol and the HL7 model using the
HAPI library.

HTTP4 /
camel-http4

http4://hostname[:port]

For calling out to external HTTP servers using Apache HTTP Client
4.x

IMAP /
camel-mail

imap://hostname[:port]

Receiving email using IMap

Infinispan / camel-infinispan

infinispan://hostName[?options]

For reading/writing from/to Infinispan
distributed key/value store and data grid

Jasypt
/ camel-jasypt

jasypt: uri

Simplified on-the-fly encryption library, integrated with Camel.

JCR /
camel-jcr

jcr://user:password@repository/path/to/node

Storing a message in a JCR (JSR-170) compliant repository like
Apache
Jackrabbit

JDBC /
camel-jdbc

jdbc:dataSourceName?options

For performing JDBC queries and operations

Jetty /
camel-jetty

jetty:url

For exposing services over HTTP

JGroups / camel-jgroups

jgroups:clusterName[?options]

The jgroups: component provides exchange of messages
between Camel infrastructure and JGroups clusters.

JMS /
camel-jms

jms:[topic:]destinationName

Working with JMS providers

JMX /
camel-jmx

jmx://platform?options

For working with JMX notification listeners

JPA /
camel-jpa

jpa://entityName

For using a database as a queue via the JPA specification for
working with OpenJPA, Hibernate or TopLink

Jsch /
camel-jsch

scp://localhost/destination

Support for the scp protocol.

Kafka /
camel-kafka

kafka://server:port[?options]

For producing to or consuming from Apache Kafka
message brokers.

Krati /
camel-krati

krati://[path to datastore/][?options]

For producing to or consuming to Krati datastores.

Log /
camel-core

log:loggingCategory[?level=ERROR]

Uses Jakarta Commons Logging to log the message exchange to some
underlying logging system like log4j

Lucene
/ camel-lucene

lucene:searcherName:insert [?analyzer=<analyzer>]

Uses Apache Lucene to perform Java-based indexing and full text
based searches using advanced analysis/tokenization
capabilities

MINA2 /
camel-mina2

mina2:[tcp|udp|vm]:host[:port][?options]

Working with Apache
MINA 2.x
.

Mock /
camel-core

mock:name

For testing routes and mediation rules using mocks

MongoDB / camel-mongodb

mongodb:connectionBean[?options]

Interacts with MongoDB databases and collections. Offers producer
endpoints to perform CRUD-style operations and more against
databases and collections, as well as consumer endpoints to listen
on collections and dispatch objects to Camel routes.

MQTT /
camel-mqtt

mqtt:name[?options]

Component for communicating with MQTT M2M message brokers

Mustache / camel-mustache

mustache:templateName[?options]

Generates a response using a Mustache
template.

MyBatis / camel-mybatis

mybatis://statementName

Performs a query, poll, insert, update or delete in a relational
database using MyBatis.

Netty /
camel-netty-http

netty-http:http:[port]/context-path[?options]

Works as Netty HTTP server and client using the Netty project.

OptaPlanner / camel-optaplanner

optaplanner:solverConfig[?options]

Solves the planning problem contained in a message with OptaPlanner.

POP3 /
camel-mail

pop3://user-info@host:port

Receiving email using POP3 and JavaMail.

Properties / camel-core

properties://key[?options]

The properties component facilitates using property placeholders
directly in endpoint uri definitions.

Quartz
/ camel-quartz

quartz://groupName/timerName

Provides a scheduled delivery of messages using the Quartz
scheduler

Quartz2 / camel-quartz2

quartz2://groupName/timerName[?options]

Provides a scheduled delivery of messages using the Quartz 2.x
scheduler
.

RabbitMQ / camel-rabbitmq

rabbitmq://hostname[:port]/exchangeName[?options]

Component for integrating with RabbitMQ.

Ref /
camel-core

ref:name

Component for lookup of existing endpoints bound in the Camel
Registry.

RMI /
camel-rmi

rmi://host[:port]

Working with RMI

RSS /
camel-rss

rss:uri

Working with ROME for RSS integration, such as consuming an RSS feed.

Salesforce / camel-salesforce

salesforce:topic[?options]

To integrate with Salesforce.

SAP
NetWeaver
/ camel-sap-netweaver

sap-netweaver:hostName[:port][?options]

To integrate with SAP NetWeaver
Gateway
.

SEDA /
camel-core

seda:name

Asynchronous call to another endpoint in the same Camel
Context

SERVLET / camel-servlet

servlet:uri

For exposing services over HTTP through the servlet which is
deployed into the Web container.

SJMS /
camel-sjms

sjms:[queue:|topic:]destinationName[?options]

A ground up implementation of a JMS client.

SFTP /
camel-ftp

sftp://host[:port]/fileName

Sending and receiving files over SFTP (FTP over SSH).

SMTP /
camel-mail

smtp://user-info@host[:port]

Sending email using SMTP and JavaMail

SMPP /
camel-smpp

smpp://user-info@host[:port]?options

To send and receive SMS using Short Messaging Service Center
using the JSMPP
library

SNMP /
camel-snmp

snmp://host[:port]?options

Polling OID values and receiving traps using SNMP via SNMP4J library

Solr /
camel-solr

solr://hostName[:port]/solr[?options]

Uses the Solrj client API to interface with an Apache Lucene
Solr
server.

Splunk
/ camel-splunk

splunk://[endpoint]?[options]

For working with Splunk

SpringBatch / camel-spring-batch

spring-batch:jobName[?options]

To bridge Camel and Spring
Batch
.

SpringIntegration / camel-spring-integration

spring-integration: defaultChannelName

The bridge component of Camel and Spring Integration

Spring
LDAP
/ camel-spring-ldap

spring-ldap:springLdapTemplateBean[?options]

Camel wrapper for Spring LDAP

Spring
Redis
/ camel-spring-redis

spring-redis://hostName:port[?options]

Component for consuming and producing from Redis key-value store
Redis

Spring Web Services / camel-spring-ws

spring-ws:[mapping-type:]address[?options]

Client-side support for accessing web services, and server-side
support for creating your own contract-first web services using
Spring Web Services

SQL / camel-sql

sql:select * from table where id=#

Performing SQL queries using JDBC

SSH /
camel-ssh

ssh:[username[:password]@]host [:port][?options]

For sending commands to a SSH server

StAX /
camel-stax

stax:(contentHandlerClassName|#myHandler)

Process messages through a SAX ContentHandler.

Stomp /
camel-stomp

stomp:queue:destinationName[?options]

For communicating with Stomp compliant message brokers, like Apache ActiveMQ
or ActiveMQ
Apollo

Stub /
camel-core

stub:someOtherCamelUri

Allows you to stub out some physical middleware endpoint for
easier testing or debugging

Test /
camel-spring

test:expectedMessagesEndpointUri

Creates a Mock endpoint which expects to receive all the message
bodies that could be polled from the given underlying endpoint

Timer /
camel-core

timer://name

A timer endpoint

Twitter / camel-twitter

twitter://endpoint[?options]

A twitter endpoint

Velocity / camel-velocity

velocity:someTemplateResource

Generates a response using an Apache Velocity
template

Vertx /
camel-vertx

vertx:eventBusName

Working with the vertx
event bus

VM /
camel-core

vm:name

Asynchronous call to another endpoint in the same JVM

Weather / camel-weather

weather://name[?options]

Polls the weather information from Open Weather
Map
.

Websocket / camel-websocket

websocket://hostname[:port][/resourceUri][?options]

Communicating with Websocket clients.

XQuery / camel-saxon

xquery:someXQueryResource

Generates a response using an XQuery
template

XSLT /
camel-spring

xslt:someTemplateResource

Generates a response using an XSLT template

Yammer
/ camel-yammer

yammer://function[?options]

Allows you to interact with the Yammer enterprise social
network.

Zookeeper / camel-zookeeper

zookeeper://zookeeperServer[:port][/path][?options]

Working with ZooKeeper cluster(s)

Scenario 1: Moving files from one message endpoint to another

This scenatio uses two cMessagingEndpoint components
to read and move files from one endpoint to another.

cMessagingEndpoint_scenario1_1.png

Dropping and linking the components

  1. From the Messaging folder of the
    Palette, drag and drop two cMessagingEndpoint components onto the design
    workspace, one as the message sender and the other as the message receiver,
    and label them Sender and Receiver respectively to better identify their
    roles in the Route.

  2. Right-click the component labeled Sender, select Row >
    Route in the menu and drag to the
    Receiver to link them together with a
    route link.

Configuring the components and connections

  1. Double-click the component labeled Sender to open its Basic
    settings
    view in the Component tab.

  2. In the URI field, type in the URI of the
    messages you want to route.

    As we are handling files, type in “file:///” and the
    path to the folder containing the files.

    cMessagingEndpoint_scenario1_2.png
  3. Double-click the component labeled Receiver to open its Basic
    settings
    view in the Component tab.

  4. In the URI field, type in the URI of the
    folder where you want to route your message.

    As we are handling files, type in “file:///” and the
    path to the folder to which the files will be sent.

    cMessagingEndpoint_scenario1_3.png
  5. Press Ctrl+S to save your Route.

Viewing code and executing the Route

  1. To have a look at the generated code, click the Code tab at the bottom of the design workspace.

    cMessagingEndpoint_scenario1_4.png

    The code shows the from and .to corresponding to
    the two endpoints: from for the sending one and
    .to for the receiving one.

  2. In the Run view, click the Run button to launch the execution of your Route.

    You can also press F6 to execute it.

    RESULT: The files are moved from their original folder to the target one.
    Furthermore, a new .camel folder is created
    in the source folder containing the consumed files. This is Camel’s default
    behavior. Thus, the files will not be processed endlessly but they are
    backed up in case of problems.

Scenario 2: Sending files to another message endpoint

This scenario accesses FTP service and transfers files from one endpoint to
another.

cMessagingEndpoint_scenario1_1.png

Dropping and linking components

  1. From the Messaging folder of the
    Palette, drag and drop two cMessagingEndpoint components onto the design
    workspace, one as the message sender and the other as the message receiver,
    and label them Sender and Receiver respectively to better identify their
    roles in the Route.

  2. Right-click the component labeled Sender, select Row >
    Route in the menu and drag to the
    Receiver to link them together with a
    route link.

Configuring the components and connections

  1. Double-click the component labeled Sender to display its Basic
    settings
    view in the Component tab.

  2. In the URI field, type in the URI of the
    message you want to route.

    Here, we are using an FTP component:
    ftp://indus@degas/remy/camel with URI specific parameters
    authenticating the FTP connection:
    ?username=indus&password=indus.

    cMessagingEndpoint_scenario2_2.png
  3. For the FTP component to work in Camel, click the Advanced settings tab of cMessagingEndpoint, click the [+] button to add a Camel component in the Dependencies table, and select
    ftp from the Camel
    component
    list to activate the FTP component.

    cMessagingEndpoint_scenario2_3.png
  4. Double-click the component labeled Receiver to open its Basic
    settings
    view in the Component tab.

  5. In the URI field, type in the URI of the
    folder to which you want your message to be routed.

    As we are handling files, type in “file:///” and the
    path to the folder to which the files will be sent.

    cMessagingEndpoint_scenario1_3.png
  6. Press Ctrl+S to save your Route.

Viewing code and executing the Route

  1. To have a look at the generated code, click the Code tab at the bottom of the design workspace.

    cMessagingEndpoint_scenario2_4.png
    cMessagingEndpoint_scenario2_5.png

    In this part of code, we can see a route represented by from
    and .to, corresponding to the sending and receiving
    endpoints.

  2. In the Run view, click the Run button to launch the execution of your Route.

    You can also press F6 to execute it.

    RESULT: The message is sent (copied) to the receiving endpoint.

Scenario 3: Using an Xquery endpoint to filter messages

In this scenario, we will use a cMessagingEndpoint
component to call a Route Resource as an Xquery parser to extract messages from the
local file system.

The following sample XML file is used in this scenario:

Creating a Route Resource

  1. From the repository tree view, right-click the Resources node and select Create
    Resource
    from the context menu.

    use_case_ccxf12.png
  2. The [New Route Resource] wizard opens. In the Name field, type in a name for the Resource, for
    example, SampleXquery. Click Finish to close the wizard.

    use_case_cmessagingendpoint_scenario3_1.png
  3. Enter the following code in the editor to extract the
    firstName and lastName of all
    the person elements.

  4. Press Ctrl+S to save your Route
    Resource.

Dropping and linking the components

use_case_cmessagingendpoint_scenario3_2.png
  1. From the Messaging folder of the
    Palette, drag and drop a cFile and a cMessagingEndpoint component onto the design
    workspace.

  2. From the Processor folder, drag and drop
    a cProcessor component onto the design
    workspace.

  3. Link the components with the Row >
    Route connection as shown above.

  4. Label the components for better identification of their
    functionality.

Configuring the components and connections

  1. Double-click the cFile component to open
    its Basic settings view in the Component tab.

    use_case_cmessagingendpoint_scenario3_3.png
  2. In the Path field, specify the path where
    the source file people.xml is located.

  3. Right-click the Route from the repository tree view and select Manage Route Resources from the context
    menu.

    use_case_cmessagingendpoint_scenario3_4.png

    The [Manage Route Resources] wizard is opened.

    use_case_cmessagingendpoint_scenario3_7.png
  4. In the [Manage Route Resources] wizard, click Add and select SampleXquery from the Resources tree view in the dialog.
    Click OK.

    use_case_cmessagingendpoint_scenario3_6.png

    The SampleXquery Route Resource is added in the table
    of the [Manage Route Resources]
    wizard.

    use_case_cmessagingendpoint_scenario3_5.png
  5. Select the SampleXquery from the Route
    Resources list and click Copy Path. Click
    OK to close the wizard.

  6. Double click the cMessagingEndpoint
    component to display its Basic settings
    view in the Component tab.

    use_case_cmessagingendpoint_scenario3_8.png
  7. In the URI field, enter xquery: and paste the path of the Route
    Resource SampleXquery that we just copied
    in double quotation marks.

  8. Click the Advanced settings tab, add the
    Camel component saxon in the Dependencies list. For more information about
    Xquery, see Apache Camel’s Website:
    http://camel.apache.org/xquery-endpoint.html.

    use_case_cmessagingendpoint_scenario3_10.png
  9. Double-click the cProcessor component to
    open its Basic settings view in the
    Component tab.

    use_case_cmessagingendpoint_scenario3_9.png
  10. In the Code area, enter the following
    code to display the messages intercepted on the console:

  11. Press Ctrl+S to save your Route.

Viewing code and executing the Route

  1. To have a look at the generated code, click the Code tab at the bottom of the design workspace.

    use_case_cmessagingendpoint_scenario3_11.png

    As shown in the code above, the message is routed from
    Message_source_cFile_1
    .to
    cMessagingEndpoint_1 and then processed by
    cProcessor_1.

  2. In the Run view, click the Run button to launch the execution of your Route.
    You can also press F6 to execute it.

    RESULT: The firstName and
    lastName of all the person
    elements of the source file is printed in the console.

    use_case_cmessagingendpoint_scenario3_12.png

Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x