...
The logical flow of the program is:
- The filePoller polls the
inbox
directory every 1000 ms looking for a file. - Once a file appears in the
inbox
directory, the filePoller gets a thread from the workManager. The thread will be used to process the file. - The filePoller creates a normalized message that contains the file to be transmitted. It sends the normalized message to the NMR. The NMR routes the message to the fileSender component.
- The fileSender transforms the normalized message back into a file and "sends" it (places it) to the
outbox
directory.
- myComponent subscribes to the "demo.org.servicemix.source" topic. Through its template property, myComponent uses JmsFactory to listen on
port 61616 via ActiveMQConnectionFactory. - When JMSClient is executed, it tries to make a connection to the topic demo.org.servicemix.source at port 61616
- It then send a text message through this connection and waits for a response.
- myComponent receives the message and transmit it to ProcessSVC which is probably the BPEL engine as specified in the destinationService
property in the servicemix.xml file. - When the transmission is successful myComponent send a reply to the JMSClient and "Response was @response" is printed on the console.
Otherwise "Response time out" is printed.
Logginginformation Logging information is written to the console as files are transmitted. Typical output looks like the following:
...
Component or Bean ID | Description |
---|---|
filePoller myComponent | This component periodically checks the "inbox" directory looking for files. If there is a file or directory present, it adds the file to the "workingSet", which is a collection of files to be processed. The workManger is invoked to schedule the work of processing the file from the workingSet. Another thread is created and the processing of the file begins. Processing consists of marshalling the file (streaming it from disk into a normalized message). The normalized message is sent over the NMR to the fileSender component per the specified "destinationService". The destinationService is specified in the |
fileSender | This component is the "destinationService" for the filePoller. It receives normalized messages from filePoller. The messages it receives are the files that filePoller has transferred to it via the NMR. It converts the normalized message to its original file format and sends it to the destination directory, the |
workManager | This bean is used by the filePoller to increase the throughput of the application. The workManager is a thread pool whose size can be adjusted declaratively in the |
Useful Code Hints
This section describes the start-up sequence and how the ServiceMix container interacts with the BPEL application. The Java class files are located in the servicemix-1.0.1.jar file in the ServiceMix installation directory. To look at the Java source code, unjar and decompile the .class files or download the source code. Please note: the downloadable source code is slightly different than the compiled binary code.
...