Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 10. Using Poller Endpoints

Abstract

Poller endpoints poll the file system for files and passes the file to a target endpoint inside an in-only message exchange.
Important
The Java Business Integration components of Red Hat JBoss Fuse are considered deprecated. You should consider migrating any JBI applications to OSGi.

10.1. Introduction to poller endpoints

Overview

The function of a poller endpoint is to read data, in the form of files, from a location on a file system and pass that information to other endpoints in the ESB. Poller endpoints create an in-only message exchange containing the data read in from a file.
A poller endpoint, as its name implies, works by continually polling the file system to see if a file is present for consumption. The polling interval is completely customizable.
You can also control the files a poller endpoint consumes. Using the basic configuration attributes, you can configure the endpoint to poll for a specific file or you can poll it to monitor a specific directory on the file system. In addition, you can configure the endpoint to use a custom file filter.
By default, poller endpoints will only consume valid XML files. You can customize this behavior by configuring the endpoint to use a custom marshaler.

Where does a poller endpoint fit into a solution?

Poller endpoints play the role of consumer from the vantage point of the other endpoints in the ESB. As shown in Figure 10.1, “Poller endpoint”, a poller endpoint watches the file system for files to consume. When the endpoint consumes a file, it transfers its contents into a message and starts off an in-only message exchange. Poller endpoints cannot receive messages from the NMR.

Figure 10.1. Poller endpoint

poller endpoint in a message exchange

Configuration element

Poller endpoints are configured using the poller element. All its configuration can be specified using attributes of this element.
The more complex features, such as custom marshalers, require the addition of other elements. These can either be separate bean elements or child elements of the poller element.