// subscribing to the above created messsage box with configured topic
String subscriptionID = brokerClient.subscribe(msgBoxEpr.getAddress(), topic, null);
//Start the messagePuller to pull messages from newly created messagebox
MessagePuller puller = brokerClient.startPullingEventsFromMsgBox(msgBoxEpr, new Listener(), 1000L, 2000L);
sender.workflowStarted("Workflow Started");
//Here we simply assume the workflow invocation is the invoke of the subscribe operation of EventingService and result
// Is considered as the subscriptionID got from subscribe operation
String workflowResult = subscriptionID;
sender.workflowFinished(workflowResult);
try {
Thread.sleep(10000L);
} catch (InterruptedException e) {
e.printStackTrace();
}
brokerClient.unSubscribe(subscriptionID);
puller.stopPulling();
System.out.println("Delete message box response : "
+ brokerClient.deleteMsgBox(msgBoxEpr, 500L));
}