Developing Apama Applications > Apama EPL Reference > Statements > Simple statements > The emit statement
The emit statement
The emit statement publishes an event to a named channel of the correlator’s output queue. If a channel name is not specified, then the event goes to the default channel whose name is the empty string ( ""). External receivers get events on the default channel only if they are subscribed to all channels.
Note: The emit statement will be deprecated in a future release. Use the send statement instead. See The send . . . to statement.
EmitStatement
Rule components
The first expression is an expression whose result type is either an event type or string. If the type is string, then the value of the string is assumed to be in the same format as that produced by the event’s toString() method.
The expression following the keyword to must be of type string and is the name of the channel to which the event will be sent.
The emit method dispatches events to external registered event receivers. That is, the emit statement causes events to go out of the correlator. Active event listeners will not receive events that are emitted.
Events are emitted onto named channels. For an application to receive events from the correlator it must register itself as an event receiver and subscribe to one or more channels. Then if events are emitted to those channels they will be forwarded to it.
Channels effectively allow both point-to-point message delivery as well as through publish-subscribe. Channels can be set up to represent topics. External applications can then subscribe to event messages of the relevant topics. Otherwise a channel can be set up purely to indicate a destination and have only one application connected to it.
You cannot emit an event whose type is defined inside a monitor.
You cannot emit an event that has a field of type action, chunk, listener, or stream.
When you emit an event type that has a dictionary field, the items in the dictionary are sorted in ascending order of their key values.
Copyright © 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.