August 15, 2023

cMessagingEndpoint – Docs for ESB 6.x

cMessagingEndpoint

Allows two applications to communicate by either sending or receiving messages.

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

AHC
(camel-ahc)

ahc:httpUri

To call external HTTP services using Async
Http Client.

AHC
Websocket
(camel-ahc-ws)

ahc-ws:httpUri

To exchange data with external Websocket servers using
Async Http Client.

APNS
(camel-apns)

apns:name

For sending notifications to Apple iOS
devices.

Avro
(camel-avro)

avro:transport:host:port/messageName

Working with Apache Avro for data
serialization.

Atom
(camel-atom)

atom:feedUri

For consuming Atom RSS feeds.

Atmosphere
Websocket
(camel-atmosphere-websocket)

atmosphere-websocket:servicePath

To exchange data with external Websocket clients using
Atmosphere.

Braintree
(camel-braintree)

braintree:apiName/methodName

For integrating with the Braintree Payment System.

Camel
Context
(camel-context)

context:contextId:localEndpointUrl

To send/receive messages between Camel routes in a
black box way. This component is deprecated.

CMIS
(camel-cmis)

cmis:cmsUrl

The cmis component uses the Apache
Chemistry client API and allows you to add/read
nodes to/from a CMIS compliant content
repositories.

CoAP
(camel-coap)

coap:uri

For sending and receiving messages from COAP capable
devices.

CouchDB
(camel-couchdb)

couchdb:protocol:hostname:port/database

To integrate with CouchDB databases.

Crypto (JCE)
(camel-crypto)

crypto:cryptoOperation:name

For signing and verifying exchanges using
the Signature Service of the Java Cryptographic
Extension (JCE).

CXF
(camel-cxf)

cxf:beanId:address

Works for SOAP WebServices using Apache
CXF.

Disruptor
(camel-disruptor)

disruptor:name

To provide asynchronous SEDA behavior
using LMAX Disruptor.

EHCache
(camel-cache)

cache:cacheName

To perform caching operations using EHCache as the
Cache Implementation. This component is
deprecated.

Elasticsearch (camel-elasticsearch)

elasticsearch:clusterName

For interfacing with ElasticSearch
server.

ElSQL
(camel-elsql)

elsql:elsqlName:resourceUri

The ElSQL component is an extension to the existing SQL
Component that uses ElSql to define the SQL
queries.

etcd
(camel-etcd)

etcd:namespace/path

To work with Etcd, a distributed reliable key-value
store.

Exec
(camel-exec)

exec:executable

To execute OS system commands.

Facebook
(camel-facebook)

facebook:methodName

To provide access to all of the Facebook
APIs accessible using Facebook4J.

Flatpack
(camel-flatpack)

flatpack:type:resourceUri

The flatpack component supports fixed
width and delimited file parsing via the FlatPack
library.

FOP
(camel-fop)

fop:outputType

To render a message into different output
formats using Apache FOP.

Freemarker
(camel-freemarker)

freemarker:resourceUri

Transforms the message using a FreeMarker
template.

FTP
(camel-ftp)

ftp:host:port/directoryName

For uploading or downloading files from
FTP servers.

Geocoder
(camel-geocoder)

geocoder:address:latlng

For looking up geocodes (latitude and
longitude) for a given address or reverse
lookup.

Git
(camel-git)

git:localPath

For working with git repositories.

Guava
EventBus
(camel-guava-eventbus)

guava-eventbus:eventBusRef

Provides integration bridge between Camel
and Google Guava EventBus.

Grape
(camel-grape)

grape:defaultCoordinates

To fetch, load and manage additional jars when
CamelContext is running.

HBase
(camel-hbase)

hbase:tableName

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

HDFS
(camel-hdfs)

hdfs:hostName:port/path

For reading/writing from/to an HDFS file
system using Hadoop 1.x. This component is
deprecated.

HDFS2
(camel-hdfs2)

hdfs2:hostName:port/path

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

HTTP4
(camel-http4)

http4:httpUri

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

Ignite Cache
(camel-ignite)

ignite-cache:cacheName

The Ignite Cache endpoint is one of camel-ignite
endpoints which allows you to interact with an
Ignite Cache.

Infinispan
(camel-infinispan)

infinispan:cacheName

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

IronMQ
(camel-ironmq)

ironmq:queueName

The ironmq provides integration with IronMQ an elastic
and durable hosted message queue as a service.

JBPM
(camel-jbpm)

jbpm:connectionURL

Provides integration with jBPM (Business Process
Management).

JCache
(camel-jcache)

jcache:cacheName

To perform caching operations using JSR107/JCache as
cache implementation.

JCR
(camel-jcr)

jcr:host/base

To add/read nodes to/from a JCR
compliant content repository.

JDBC
(camel-jdbc)

jdbc:dataSourceName

To access databases through JDBC where
SQL queries are sent in the message body.

Jetty 9
(camel-jetty9)

jetty:httpUri

Provides HTTP-based endpoints for consuming and
producing HTTP requests.

JGroups
(camel-jgroups)

jgroups:clusterName

Provides exchange of messages between
Camel and JGroups clusters.

JMS
(camel-jms)

jms:destinationType:destinationName

Allows messages to be sent to, or
consumed from a JMS Queue or Topic.

JMX
(camel-jmx)

jmx:serverURL

To receive JMX notifications.

JOLT
(camel-jolt)

jolt:resourceUri

To process JSON messages using an JOLT specification
(such as JSON-JSON transformation).

JPA
(camel-jpa)

jpa:entityType

To store and retrieve Java objects from
databases using JPA.

Jsch
(camel-jsch)

scp:host:port/directoryName

To copy files using the secure copy protocol (SCP).

Kafka
(camel-kafka)

kafka:topic

Allows messages to be sent to, or
consumed from Apache Kafka brokers.

Krati
(camel-krati)

krati:path

Allows the use of krati datastores and
datasets inside Camel.

Kubernetes
(camel-kubernetes)

kubernetes:masterUrl

To work with Kubernetes PaaS.

Lucene
(camel-lucene)

lucene:host:operation

To insert or query from Apache Lucene
databases.

Mail
(camel-mail)

imap:host:port

To send or receive emails using imap/pop3 or smtp
protocols.

Mina2
(camel-mina2)

mina2:protocol:host:port

Socket level networking using TCP or UDP
with the Apache Mina 2.x library.

MLLP
(camel-mllp)

mllp:hostname:port

Provides functionality required by Healthcare providers
to communicate with other systems using the MLLP
protocol.

Mock
(camel-core)

mock:name

For testing routes and mediation rules
using mocks.

MongoDB
(camel-mongodb)

mongodb:connectionBean

For working with documents stored in
MongoDB database.

MongoDB
GridFS
(camel-mongodb-gridfs)

mongodb-gridfs:connectionBean

For working with MongoDB GridFS.

MQTT
(camel-mqtt)

mqtt:name

For communicating with MQTT M2M message
brokers using FuseSource MQTT Client.

Mustache
(camel-mustache)

mustache:resourceUri

Transforms the message using a Mustache
template.

MyBatis
(camel-mybatis)

mybatis:statement

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

Nats
(camel-nats)

nats:servers

Produces and consumes messages from NATS.

Netty
(camel-netty)

netty:protocol:host:port

Socket level networking using TCP or UDP
with the Netty 3.x library. This component is
deprecated.

OpenShift
(camel-openshift)

openshift:clientId

To Manage your Openshift 2.x applications. This
component is deprecated.

OptaPlanner
(camel-optaplanner)

optaplanner:configFile

Solves the planning problem contained
in a message with OptaPlanner.

Paho
(camel-paho)

paho:topic

For communicating with MQTT M2M message brokers using
Eclipse Paho MQTT Client.

PDF
(camel-pdf)

pdf:operation

Provides the ability to create, modify or extract
content from PDF documents.

Quartz
(camel-quartz)

quartz:groupName/timerName

Provides a scheduled delivery of
messages using the Quartz 1.x scheduler. This
component is deprecated.

Quartz2
(camel-quartz2)

quartz2:groupName/triggerName

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

RabbitMQ
(camel-rabbitmq)

rabbitmq:hostname:portNumber/exchangeName

To produce and consume messages from
RabbitMQ instances.

RMI
(camel-rmi)

rmi:hostname:port/name

For invoking Java RMI beans from
Camel.

RSS
(camel-rss)

rss:feedUri

For consuming RSS feeds.

Salesforce
(camel-salesforce)

salesforce:operationName:topicName

For integrating Camel with the massive
Salesforce API.

SAP
NetWeaver
(camel-sap-netweaver)

sap-netweaver:url

To integrate with the SAP NetWeaver
Gateway using HTTP transports.

Servlet
(camel-servlet)

servlet:contextPath

To use a HTTP Servlet as entry for Camel
routes when running in a servlet container.

Simple JMS
(camel-sjms)

sjms:destinationType:destinationName

Allows messages to be sent to, or
consumed from a JMS Queue or Topic (uses JMS 1.x
API).

Slack
(camel-slack)

slack:channel

To send messages to Slack.

SMPP
(camel-smpp)

smpp:host:port

To send and receive SMS using a SMSC
(Short Message Service Center).

SNMP
(camel-snmp)

snmp:host:port

To poll SNMP capable devices or
receiving traps.

Solr
(camel-solr)

solr:url

To interface with an Apache Lucene Solr
server.

Splunk
(camel-splunk)

splunk:name

To publish or search for events in
Splunk.

Spring Batch
(camel-spring-batch)

spring-batch:jobName

To send messages to Spring Batch for
further processing.

Spring
Integration
(camel-spring-integration)

spring-integration:defaultChannel

Bridges Camel with Spring
Integration.

Spring LDAP
(camel-spring-ldap)

spring-ldap:templateName

To perform searches in LDAP servers
using filters as the message payload.

Spring Redis
(camel-spring-redis)

spring-redis:host:port

To send and receive messages from
Redis.

Spring
WebService
(camel-spring-ws)

spring-ws:type:lookupKey:webServiceEndpointUri

Works for SOAP WebServices using Spring
WebServices.

SQL
(camel-sql)

sql:query

To work with databases using JDBC SQL
queries.

SSH
(camel-ssh)

ssh:host:port

The ssh component enables access to SSH
servers so that you can send an SSH command and
process the response.

StAX
(camel-stax)

stax:contentHandlerClass

Allows messages to be process through a
SAX ContentHandler.

Stomp
(camel-stomp)

stomp:destination

For communicating with Stomp compliant
message brokers.

Twitter
(camel-twitter)

twitter:kind

Integrates with Twitter to send tweets or
search for tweets and more.

Undertow
(camel-undertow)

undertow:httpURI

Provides HTTP-based endpoints for consuming and
producing HTTP requests.

Velocity
(camel-velocity)

velocity:resourceUri

Transforms the message using a Velocity
template.

Vertx
(camel-vertx)

vertx:address

For sending and receive messages from a
vertx event bus.

Weather
(camel-weather)

weather:name

Polls the weather information from Open
Weather Map.

Yammer
(camel-yammer)

yammer:function

To interact with the Yammer enterprise
social network.

ZooKeeper
(camel-zookeeper)

zookeeper:serverUrls/path

Allows interaction with a ZooKeeper
cluster.

Configuring connection to the WebSphere MQ native server using the WMQ
component

When using the cMessagingEndpoint to address an
endpoint in a WebSphere MQ native server by calling WMQ, the connection to the MQ QueueManager can be configured in the URI
field or in a properties file. The following properties can be configured:

  • queueManagerName: The name of the MQ QueueManager. If not
    specified, the component falls back to default.

  • queueManagerHostname: The hostname of the MQ
    QueueManager.

  • queueManagerPort: The port of the MQ QueueManager.

  • queueManagerChannel: The channel of the MQ
    QueueManager.

  • queueManagerUserID: The user ID (optional, only required for
    authentication).

  • queueManagerPassword: The user password (optional, only
    required for authentication).

  • queueManagerCCSID: The CCSID (optional, only required for
    authentication).

If the queueManagerHostname, queueManagerPort,
and queueManagerChannel is not specified in the URI, the component loads a
mq.properties file from the classloader. An example of a
mq.properties shown as follows:

The mq.properties can contain multiple MQ Queue Managers definition. The
format is:

where the name is the QueueManager name. For example, the
mq.properties file can contain:

The mq.properties also supports the userID,
password, and CCSID properties. For example:

To call the mq.properties, use a cConfig component and add it
to the Dependencies table. To run the Route with this component in the studio,
you need to download the com.ibm.mq.jar,
com.ibm.mq.commonservices.jar,
com.ibm.mq.headers.jar,
com.ibm.mq.jmqi.jar and connector.jar from
the IBM web site and add them to the Dependencies list
of the cConfig too. For more information about the
cConfig component, see cConfig.

If the Route with this component is deployed in Runtime, the
mq.properties file will be called from
<TalendRuntimePath>/container/etc folder. Furthermore, you need to
download com.ibm.mq.osgi.java_7.5.0.5.jar from the IBM web site and
add it to the <TalendRuntimePath>/container/deploy folder.
Alternatively, copy the com.ibm.mq.jar,
com.ibm.mq.commonservices.jar,
com.ibm.mq.headers.jar,
com.ibm.mq.jmqi.jar and connector.jar to
the <TalendRuntimePath>/container/lib/ext folder and change
<TalendRuntimePath>/container/etc/custom.properties by adding the
MQ packages to org.osgi.framework.system.packages.extra:

For more information about the WMQ component, see the site https://github.com/camel-extra/camel-extra/tree/master/components/camel-wmq.

You can also use the cMQConnectionFactory component
to create a connection to the WebSphere MQ native server, and use the cWMQ to communicate with the MQ QueueManager. For more
information, see cMQConnectionFactory and cWMQ.

cMessagingEndpoint Standard properties

These properties are used to configure cMessagingEndpoint running in the Standard Job framework.

The Standard
cMessagingEndpoint component belongs to the Core family.

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 custom component
should be included in the jar file.

Usage

Usage rule

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

Limitation

 n/a

Scenario 1: Moving files from one message endpoint to another

This scenario applies only to a Talend solution with ESB.

This scenario 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 Core 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 applies only to a Talend solution with ESB.

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

cMessagingEndpoint_scenario1_1.png

Dropping and linking components

  1. From the Core 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

This scenario applies only to a Talend solution with ESB.

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 Connectivity folder of the
    Palette, drag and drop a cFile and a cMessagingEndpoint component onto the design
    workspace.
  2. From the Custom 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