Package io.camunda.zeebe.dispatcher
Interface FragmentHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Consume fragments from the buffer.
Note that the handler is not aware of fragment batches.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intfragment consumed successfully *static final intfragment consumed with failure *static final intfragment not consumed * -
Method Summary
Modifier and TypeMethodDescriptionintonFragment(org.agrona.DirectBuffer buffer, int offset, int length, int streamId, boolean isMarkedFailed) Consume the message from the given buffer.
-
Field Details
-
CONSUME_FRAGMENT_RESULT
static final int CONSUME_FRAGMENT_RESULTfragment consumed successfully *- See Also:
-
POSTPONE_FRAGMENT_RESULT
static final int POSTPONE_FRAGMENT_RESULTfragment not consumed *- See Also:
-
FAILED_FRAGMENT_RESULT
static final int FAILED_FRAGMENT_RESULTfragment consumed with failure *- See Also:
-
-
Method Details
-
onFragment
int onFragment(org.agrona.DirectBuffer buffer, int offset, int length, int streamId, boolean isMarkedFailed) Consume the message from the given buffer.- Parameters:
buffer- the buffer which contains the messageoffset- the message offset (i.e. the start position of the message in the buffer)length- the message lengthstreamId- the fragments stream idisMarkedFailed-trueif a handler consumed this message previously with failure (i.e. result wasFAILED_FRAGMENT_RESULT).- Returns:
- the consume result which should be one of
CONSUME_FRAGMENT_RESULT,FAILED_FRAGMENT_RESULTorPOSTPONE_FRAGMENT_RESULT.
-