FlowWright Enterprise Service Bus (ESB)
FlowWright has a powerful ESB that is similar to a traditional publisher-subscriber model, but a one that improves that model to improve performance. FlowWright utilizes Event definition and Event handler definitions to create a bridge between Events and Event handlers.
Once Events and Event handlers are defined within FlowWright using the Configuration Manager, Event handlers can be assigned to Events. A single Event may have any number of Event handlers assigned to that Event. The same Event handler can be also attached to multiple events.
Events can be published using the .Net API or the Web service API.
Once an Event is published to the ESB, assigned event handlers will act on the Event.
Creating a new Event handler
A new event handler can be implemented using the interface deEventHandler. The interface has one simple method called “execute” that needs to be implemented. Below is code for a sample event handler:
The above code writes all parameters of the event to a text file, it’s a simple event handler that demonstrates the configuration and execution of the event. After compiling the event handler to a DLL, place the DLL file within the “BIN” directory:
Using the menu for the ESB, select menu item “Event Handlers”:
Use the “Auto Detect” feature to auto configure the event handler within FlowWright:
Select the new event handler from the list and select “Manage->Configure” menu item.
Using the new event handler with an event
Let’s create a new event within FlowWright by navigating to “Event Definitions” on the menu:
Create a new event called “sampleEvent” by selecting “Actions->Create” dialog:
Once the event definition is created, let’s join the event handler to the event definition, navigate to the “ESB” menu item:
Select the menu item “Actions->Create” to create a new subscriber for the event:
Configure the subscriber using the values/selection shown in the above create dialog.
Testing the event
Now that the event, event handler and the subscriber is configured, let’s test the event using the “Generate Events” UI:
Select the event “sampleEvent” and click the button “Generate Event” to publish the event to the ESB.
In order to view the generated event, navigate to the “View Events” UI:
You should see the newly generated event in the list.
Publishing events to the ESB
The following code shows how to publish an Event to the FlowWright ESB.