Provider configurations

We have concentrated on the InVM transport in this chapter, the most interesting and challenging provider to use, however JBoss ESB supports other transports for delivery of messages to a service.

Each of the following sub-sections will briefly cover the specialized tags of some of those providers, used when configuring the provider within the jboss-esb.xml file, and show snippets of the relevant quickstarts to provide an idea of their configuration and use.

You are encouraged to try out each provider, using the JBoss ESB Editor from Eclipse, and compare their behavior and capabilities with those of the InVM transport.

JMS provider

A JMS provider can be used to define providers that are based on JMS queues and topics. The transport-specific implementations are <jms-provider>, <jms-bus>, <jms-listener>, and <jms-message-filter> with the specification of the <jms-message-filter> being supported by both the <jms-bus> or <jms-listener> elements. The <jms-provider> and <jms-bus> elements are used to specify the JMS connection properties whereas the <jms-message-filter> element is used to specify the JMS queue or topic and also the details of any JMS selector which is necessary to filter the incoming messages.

A typical JMS provider configuration would look like this:

<jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
  <jms-bus busid="quickstartGwChannel">
    <jms-message-filter dest-type="QUEUE"
         dest-name="queue/quickstart_helloworld_action_Request"/>
  </jms-bus>
  <jms-bus busid="quickstartEsbChannel">
    <jms-message-filter dest-type="QUEUE"
         dest-name="queue/quickstart_helloworld_action_esb"/>
  </jms-bus>
</jms-provider>

Note

For more information on the Java Message Service API you can check out the specification available at http://jcp.org/en/jsr/detail?id=914.

Have a go hero – JMS action quickstart

Have a look at the helloworld_action quickstart. This demonstrates the usage of the JMS provider and QUEUE selection from HornetQ, JBoss Messaging, and JBoss MQ.

FTP provider

An FTP provider can be used to define providers that are based on remote file system locations using a secure or unsecure connection. These transport specific implementations are <ftp-provider>, <ftp-bus>, <ftp-listener>, and <ftp-message-filter>. The <ftp-message-filter> can be added to either the <ftp-bus> or <ftp-listener> elements. Where <ftp-provider> and <ftp-bus> specify the FTP access properties, <ftp-message-filter> specifies the message/file selection and processing properties.

A typical FTP provider configuration would look like this:

<ftp-provider name="FTPprovider" hostname="@FTP_HOSTNAME@" >
  <ftp-bus busid="helloFTPChannel" >
    <ftp-message-filter username="@FTP_USERNAME@"
                        password="@FTP_PASSWORD@"
                        passive="false"
                        directory="@FTP_DIRECTORY@"
                        input-suffix=".dat"
                        work-suffix=".esbWorking"
                        post-delete="false"
                        post-rename="true"
                        post-suffix=".COMPLETE"
                        error-delete="false"
                        error-suffix=".HAS_ERROR"/>
  </ftp-bus>
</ftp-provider>

Have a go hero – the FTP action quickstart

Have a look at the helloworld_ftp_action quickstart. This demonstrates the usage of FTP provider and FTP message queues.

Note

JBoss ESB also supports the FTPS and SFTP protocols, however, discussion of these configurations is beyond the scope of this book.

SQL provider

A SQL provider can be used to define providers that are based on database systems using a secure or unsecure connection. These transport-specific implementations are <sql-provider>, <sql-bus>, <sql-listener>, and <sql-message-filter>. The <sql-message-filter> can be added to either the <sql-bus> or <sql-listener> elements. Where the <sql-provider> and <sql-bus> specify the JDBC connection properties, the <sql-message-filter> specifies the message/row selection and processing properties.

A typical SQL provider configuraton would look like this:

<sql-provider name="SQLprovider"
              url="jdbc:hsqldb:hsql://localhost:1704"
              driver="org.hsqldb.jdbcDriver"
              username="sa" password="">
  <sql-bus busid="helloSQLChannel" >
    <sql-message-filter tablename="GATEWAY_TABLE"
                        status-column="STATUS_COL"
                        order-by="DATA_COLUMN"
                        where-condition="DATA_COLUMN like 'data%'"
                        message-column="message"
                        message-id-column="UNIQUE_ID"
                        insert-timestamp-column="TIMESTAMP_COL"/>
  </sql-bus>
</sql-provider>

Have a go hero – the SQL action quickstart

Have a look at the helloworld_sql_action quickstart. This demonstrates the usage of the SQL provider and row selection from hsqldb tables.

File provider

A file provider can be used to define providers that are based on file systems. These transport-specific implementations are <fs-provider>, <fs-bus>, <fs-listener>, and <fs-message-filter>. The <fs-message-filter> can be added to either the <fs-bus> or <fs-listener> elements. Where the <fs-provider> and <fs-bus> specify the file system properties, the <fs-message-filter> specifies the message/file selection and processing properties.

A typical file system provider configration would look like this:

<fs-provider name="FSprovider1">
  <fs-bus busid="helloFileChannel" >
    <fs-message-filter directory="@INPUTDIR@"
                       input-suffix=".dat"
                       work-suffix=".esbWorking"
                       post-delete="false"
                       post-directory="@OUTPUTDIR@"
                       post-suffix=".sentToEsb"
                       error-delete="false"
                       error-directory="@ERRORDIR@"
                       error-suffix=".IN_ERROR"/>
  </fs-bus>
</fs-provider>

Have a go hero – file providers

Modify the sample at the beginning of this chapter to include file prefixes as needed for processing. Examine how those files are processed and experiment with the vrious settings depicted here.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset