This package which is located in sas.svc.events.jar includes sample programs that send events to an EventBroker service for demonstration and testing purposes.
Refer to this document for deployment details. A sample deployment file, deployment.xml, is included in this package. This Foundation Service deployment file can be imported into a SAS Metadata Repository using the Foundation Service Manager Plug-in component of the SAS Management Console.
If you will be using the StoredProcess samples, you must edit the InformationService repository definitions by editing the Host, Port, Domain, and Base definitions for each repository (omi, dav). For example the Sample repository should contain the following values: Host="host where the SAS Metadata Repository is running", Port="port where the SAS Metadata Repository is listening", Domain="authentication domain in which the SAS Metadata Repository is running". The webDAV repository should contain the following values: Host="host where the webDAV server is running", Port="port where the webDAV server is listening", Domain="authentication domain in which the webDAV server is running", Base="the webDAV base path". You must also edit the UserService global profile by specifying the appropriate Domain URL to designate where to store global profile information (most likely in the Sample omi repository).
Define users if events will be run under a security context. Refer to security considerations for more detail. This step is necessary if you will be using the StoredProcess samples.
Use the User Manager Plug-in component of the SAS Management Console to define new users.
Before running the StoredProcess samples you will need to define a StoredProcess Server using the Server Manager Plug-in component of the SAS Management Console.
You will also need to define the individual StoredProcess samples using the Stored Process Manager Plug-in component of the SAS Management Console. You can use the LoadStoredProcessSamples.sas program to load the stored process samples. However, you still must fully configure these stored processes by associating them to the appropriate SAS StoredProcess Server and source directory.
Process flows are one type of handling agent that can process events.
HelloWorld is a very simple request/response event. When this event is triggered at an event broker, it will invoke the HelloWorldFlow process flow. This process flow contains only one node that simply echos the incoming event properties and event body in the returned result.
To demonstrate the firing of this event, the following samples are provided:
This sample assumes that the broker is running on localhost and listening on port 8101 for HTTP requests.
ProfitLoss is a more complex request/response event that demonstrates message manipulation and propagation. The idea behind this event is to analyze sales regions in a particular company to determine if the actual sales in a region exceeded the projected outcome. When this event is triggered at an event broker, it will invoke the ProfitLossFlow process flow. This process flow contains five processing nodes. The first node demonstrates the use of properties by obtaining the Company property from the event properties and using its value as the name of the company to analyze. This node will then create a new message that contains only a subset of information from the original message that pertains to the desired company to analyze and propagates this message to the next node in the flow. This next node will then determine the regions that are profitable and the regions that are not profitable. It will then create two messages: one message containing profitable regions and the other containing non-profitable regions. It will then propagate these messages to different nodes for further processing. ProfitLossFlowNode3 processing node will receive the message containing profitable regions. This node will create a new message that summarizes the profitable regions and their total profitability. This output message is then propagated to the final processing node, ProfitLossFlowNode5. Likewise, ProfitLossFlowNode4 processing node will receive the message containing regions with losses. This node will create a new message that summarizes the regions with losses and their total net loss. This output message is also propagated to the final processing node, ProfitLossFlowNode5. The final processing node will join the information it receives from its two input messages and send the result back to the event originator as the response.
To demonstrate the firing of this event, the following samples are provided:
This sample assumes that the broker is running on localhost and listening on port 8101 for HTTP requests.
This sample assumes that the broker is running on localhost and listening on port 8102 for HTTP-SOAP requests.
This sample assumes that the Web Server is running on localhost and listening on port 8080 and that the broker is running on localhost and listening on port 8101.
This sample assumes that a WebsphereMQ messaging system in running on localhost and has a QueueManager listening on port 1414. It also assumes that a Server Connection by the name of JAVA.CHANNEL and queues by the name of LOCAL and RESPQ queue have been defined under this same QueueManager. You can change any of these parameters by modifying the JMS.properties file. You will also need to modify the event broker configuration for this MQJMS transport as well by using the Foundation Service Manager Plug-in.
You can use the com.sas.services.events.broker.samples.ReceiveJMSReply java program to fetch the event broker's reply off of the replyToQueue.
You should refer to your JMS-provider's documentation for setting up and configuring your message subsystem.
ProductSales is a stored process request/response event. When this event is triggered at an event broker, it will invoke the ProductSalesFlow process flow. This process flow contains a single node, ExecuteSPNode, that invokes the productsales.sas stored process on the designated SAS StoredProcess Server. The input to this stored process is the name of the country and year that you are interested in analyzing. The resulting dataset is the response that is sent to the event orginator.
The ExecuteSPNode processing node must be run under a security context. Therefore, appropriate credentials must be passed with the event so that they may be authenticated and used as the security context.
To demonstrate the firing of this event, the following samples are provided:
This sample assumes that the broker is running on localhost and listening on port 8101 for HTTP requests. It also assumes that the SAS Metadata Server and the SAS StoredProcess Server are up and running on their appropriate machines.
ProductSalesAlert is another stored process request/response event. When this event is triggered at the event broker, it will invoke the ProductSalesAlertFlow process flow. This process flow contains a single node, ExecuteSPAlertNode, that invokes the productsales.sas stored process on the designated SAS StoredProcess Server. The input to this stored process is the name of the country and year that you are interested in analyzing. The resulting dataset is published to the designated webDAV server and an alert detailing this process is sent to the event originator.
The ExecuteSPAlertNode processing node must be run under a security context. Therefore, appropriate credentials must be passed with the event so that they may be authenticated and used as the security context.
To demonstrate the firing of this event, the following samples are provided:
This sample assumes that the broker is running on localhost and listening on port 8101 for HTTP requests. It also assumes that the SAS Metadata Server, the SAS StoredProcess Server, and the webDAV server are up and running on their appropriate machines.
Application listeners are one type of handling agent that can process events.
Start com.sas.services.events.broker.samples.ListenerTest java program to listen for incoming ListenerTest events. This program assumes that an event broker has been deployed as a remoteable service such that it has bound itself to an RMI Registry at the following address: //localhost:1099/com.sas.services.events.broker.EventBrokerService. When this event is triggered at the event broker, it will invoke this listener. This listener will simply reply with the following response if everything works as expected: <ListenerTest>Test was successful.</ListenerTest>
To demonstrate the firing of this event, the following samples are provided:
This sample assumes that the broker is running on localhost and listening on port 8101 for HTTP requests and the com.sas.services.events.broker.samples.ListenerTest java program is running and has registered itself to the broker as a listener for ListenerTest request/response events.