Developing Apama Applications > Developing Apama Applications in EPL > Defining Queries > Communication between monitors and queries
Communication between monitors and queries
Queries can be used with or without monitors written in EPL. If you use monitors in your query application, there are several ways to send data from a monitor to a query:
*To send an event to all Apama queries running on that correlator, send it to the com.apama.queries channel.
*Queries receive events sent to the default channel, which is useful for testing.
Note: The order in which events are processed is not guaranteed for queries. See "Event ordering" in Testing query execution.
Queries can send events to EPL monitors by using the send...to statement and specifying a channel on which the monitor is listening. The monitor author should make it clear which channel they are expecting events on. The channel name can be a single name for a given monitor or a name constructed from data in the event, so that different values are processed in parallel.
If you are using multiple correlators, be aware that communication between queries and monitors normally takes place within a single correlator. However, it is possible to use engine_connect or Universal Messaging to connect correlators. This allows an event sent on a channel on one correlator to be processed by a monitor subscribed to that channel on another correlator.
Unlike a query's history window, any state stored in EPL monitors, including in the listeners, is independent in each correlator, and is not automatically moved or shared between correlators.
Copyright © 2013-2015 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.