public class MultiMessageFilter extends Object implements BufferFilter
BufferFilter
is used for re-writing the data in the buffer to permit properly formed
multi-message payloads. This is because ErraiBus J.REP messages are delivered into the bus as
single-message payloads. This filter prepends '[' to the data coming from the buffer,
and inserts a ',' between each message in the stream. It then appends a ']' to the
message to complete the payload.
For instance, consider the following buffer data:
{"foo":"bar"}{"bar":"foo"}
This filter will transform this to:
[{"foo":"bar"},{"bar":"foo"}]
Constructor and Description |
---|
MultiMessageFilter() |
Modifier and Type | Method and Description |
---|---|
void |
after(ByteWriteAdapter outstream) |
void |
before(ByteWriteAdapter outstream) |
int |
each(int i,
ByteWriteAdapter outstream) |
public void before(ByteWriteAdapter outstream) throws IOException
before
in interface BufferFilter
IOException
public int each(int i, ByteWriteAdapter outstream) throws IOException
each
in interface BufferFilter
IOException
public void after(ByteWriteAdapter outstream) throws IOException
after
in interface BufferFilter
IOException
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.