Should the FlowReceiver be closed before recreating a new FlowReceiver?
I am following along with this solace tutorial.
I am now testing and handling this portion of the tutorial where I handle REPLAY_START_TIME_NOT_AVAILABLE: .I have added a System.out.println(consumer.isClosed()); before I recreate a new FlowReceiver to replay from the beginning. This is printing out false.
consumerFlowProperties.setReplayStartLocation(JCSMPFactory.onlyInstance().createReplayStartLocationBeginning());
System.out.println(consumer.isClosed());
consumer = session.createFlow(this, consumerFlowProperties, null, replayFlowEventHandler);
consumer.start();
Should I close this FlowReceiver before instantiating a new FlowReceiver? I am concerned that leaving a FlowReceiver open throughout the lifecycle of the application could be wasting resources of some sort.
Best Answer
-
Hi @SeanTYH,
I think you may have found a bug in the documentation/tutorial. I'll follow up on that to get it resolved, but in the mean time if you are seeing it is still open I would recommend closing it before you open a new one.
thanks,
Marc
0
Answers
-
Hi @SeanTYH,
I think you may have found a bug in the documentation/tutorial. I'll follow up on that to get it resolved, but in the mean time if you are seeing it is still open I would recommend closing it before you open a new one.
thanks,
Marc
0