See inline
> Thank you for your reply. My disruptor is initialized with event object
> named FixReportContainer let say. And each time new instance of FixReport
> Object is pass into FixReportContainer as a field. I think the problem is
> that FixReport would be collected by the GC. So I should null the FixReport
> once all consumers finish using it by adding a separate EventHandler, right?
Yes.
> Another question is :
>
> is it possible to turn off the one consumer within the onEvent() method. I
> have one consumer to connect to db but I want to turn it off if its
> connection is lost.
>
> is there any workaround to shut it down?
You would have to manually remove it's sequence from the RingBuffer.
RingBuffer.removeGatingSequence(DBConsumer.getSequence()). However,
in practise what we tend to do in these situations is leave the
consumer running and have it just drop messages on the floor if the
database connection is not available. Much simpler and easier to
implement the logic to handle the case where the connection comes back
again.
Mike.