Message collectors in Rhapsody allow multiple messages to be grouped together for processing through a filter. Messages are placed in a collector by the normal route execution threads, and in normal circumstances a collection is completed at some point in time, after which all the messages are processed through the filter simultaneously by the route execution thread.

Message collectors support the concept of a timeout. When a timeout occurs, all messages in the same bucket are released even though a collection is not complete. The timeouts are triggered by a scheduled task that polls for timeouts at regular intervals. When a timeout occurs, it retrieves the relevant messages, and either sends them to the next location individually (if the error or no-match output was selected), or alternatively sends those messages through the filter. Consequently, it is possible for a task scheduler thread to become stuck inside a filter.

Field/Action

Description

Thread Name

The internal thread name.

State

The thread state, which differs depending on the thread type. Collector threads can have the following states:

  • Waiting for collector timeout.
  • Processing timed-out messages.
  • Filtering message.
  • Routing message.

Route

The route the thread is currently running on. This is a hyperlink, or blank if the thread is not currently processing on any particular route.

Filter

The filter the thread is currently running on. This is a hyperlink, orblank if the thread is not currently processing on any particular filter.

Time in State

The amount of time the thread has been in its current state.

  • < 1 second - if less than a second.
  • The number of seconds - if less than a minute.
  • The number of minutes - if less than an hour.
  • The number of hours - if greater than an hour.

Thread Actions

  • Stack Trace - Opens a popup dialog showing a stack trace for the thread. The popup dialog allows multiple stack traces of different threads to open simultaneously, without having to pre-generate the stack traces before displaying this page.
  • Interrupt - Interrupts the thread. You must confirm this action. This sets a flag on the thread letting it know it has been interrupted. If the thread is blocked from performing some operation, it normally wakes up immediately and processes the interrupt. If the thread is busy, it may not notice the interrupt.

    While Rhapsody handles interrupts correctly, examples for existing Java code have shown incorrect ways of doing this. If you write a custom component that does not handle interrupts correctly, then it may do nothing.

    Interrupts are generally ignored if the thread is blocked within native code.

  • Terminate - Stops the thread. You must confirm this action. This calls the Java Thread.stop() method. This does not terminate the thread immediately, but causes it to throw ThreadDeath internally. This will almost always break out of any Java code, however, it is not likely to have an effect if the thread is stuck within native code.

    Rhapsody will automatically create a new thread to take the place of the thread that has been stopped.