A durable route creates a durable subscriber to the source topic thereby eliminating chances of message loss when messages flow through the route. The overview provided below gives an idea of durable subscription and its importance. Sections further explain how to configure and manage a durable subscription.
To receive messages from a Topic, a subscriber creates a connection; this connection is referred as a subscription. The two types of subscriptions are durable and non-durable, where Fiorano Output Ports are Topic with non-durable subscriptions. Such kind of subscription, under certain scenarios, can lead to message loss. Therefore, in those cases where delivery of each message is important, Fiorano recommends the usage of durable subscriptions.
Other scenarios in which enabling durable routes could be helpful are:
- Peer restart: During the event of a peer server restart while messages are flowing continuously through a route.
- Peer failover: During the event of a peer server failover while messages are flowing continuously through a route.
- Restarting a Child event process connected to a remote component: When a child event process is stopped, where its parent application is still processing messages, then the child application is bound to lose those messages. This is explained in detail under Durable routes in Child Application section.
Setting Durable Subscribers
Durable subscription can be enabled at three levels as mentioned below.
Route level
- Create the Event Process and select the route where you want Durable Subscription to be enabled.
- In the Properties panel, select the Messaging tab.
- From the Durability Source drop-down, choose Route.
- From the Durable drop-down above, select 'Yes'.
Application Level
- Create the Event Process.
- In the Properties panel and select the General tab.
- From Durable Routes drop-down, select 'Yes'.
FES level
- Open the Connection Management panel and login to FES-JMX.
- Navigate through JMX-Connection > Fiorano > ESB > Application > Controller > Application Controller > Application Controller and select config.
- In the Properties panel on the right side, select Route Durable value 'Yes'.
- Right-click FES-JMX and click Save Configurations.
Priority
Enabling Durable Subscription at the FES level sets every route in every event processes to durable. However, one can go to the individual event process and set the durable subscription for that particular event process at Application Level; the subscription set at this level will override the one set at the FES Level. Precisely, the priority is in the following order:
- Route level
- Application Level
- FES Level
Durable routes in Child Application
If a child application holds a durable route from a remote component, once the applications are started, durable subscription is established at the output port of the remote component. This durable subscriber will not be removed when the child application is stopped. The messages that are processed in parent application when the child application is killed will not be lost; hence, once the child application is started again, it will receive them.
Managing Durable Subscribers
Managing durable subscribers can be done in two ways through JMX and FMQ Dashboard. Managing subscribers involves viewing and removing subscribers.
JMX (ConnectionManagement)
View Durable Subscribers
To see all the durable subscribers in the peer server perform the following actions:
- Logon to the corresponding peer server's FPS-JMX
- Navigate through Fiorano > MQ > pubsub > PubSubsManager > TopicSubsSystem
- Right-click TopicSubsSystem and select View Operations.
In the TopicSubsSystem pop-up, click listActivePassiveSubscriberInfo() from the list on the left side, and then click the button with the respective operation name present under Invoke Operation section in the Operation tab on the right side to invoke the Result tab.
The Result tab displays the list of existing subscribers in the peer server. Click the small button next to the value of the respective subscriber (Item) to view the subscriber details in a pop-up window.
Remove Passive Durable Subscribers
Removing a durable subscriber also involves removing the stored messages associated with the subscriber, so take caution while performing the following operation.
Logon to the corresponding peer server's FPS-JMX, and navigate through Fiorano > ESB > Peer > Core > ProcessManager > EventProcessManager > removeSimilarSubscribers(string)
- To remove all the passive subscribers in an application, pass the application GUID as the input to the above JMX call.
- To remove only the subscriber of a route, pass the client ID of the route subscriber as the input to the same JMX call.
- To remove all the passive durable subscribers in the corresponding peer server, use the method removePassiveRouteSubscribers() under EventProcessManager.
To remove a particular passive durable subscriber, use the method removeSubscribers(clientID, subscriberID) under EventProcessManager. The parameters for this call, that is, clientID and SubscriberID can be referred in View Durable Subscribers.
The following figure provides a better picture.
FMQ Dashboard
By default, FMQ Dashboard will be disabled. To enable the same, perform the following actions:
Open the corresponding peer server in the Profile Management perspective.
- Navigate through Fiorano > etc and click JettyServer.
- Enable the enablestart option and if needed, change the jetty server PortNumber.
Use the URL in the following format to login to the corresponding FMQ Dashboard:
View Durable Subscribers
To display all the durable subscribers in the FMQ Dashboard, click the Durable Subscriptions tab from the left navigation panel and then click the Monitor Durable Subscription link under it. This will display all the durable subscribers and its details in a tabular format on the right side.
Remove Durable Subscribers
Removing a durable subscriber also involves removing the stored messages associated with the subscriber, so user has to take caution while performing the this operation.
- To remove the passive durable subscriber, click the Configure Durable Subscription link under the Durable Subscription tab.
- Select all the Subscription Name items which need to be removed, select Unsubscribe from the Select Action drop-down on the top and then click the Go button present next t to the drop-down.