T
- The output type of the RMQSource
@PublicEvolving public interface RMQDeserializationSchema<T> extends Serializable, ResultTypeQueryable<T>
Modifier and Type | Interface and Description |
---|---|
static interface |
RMQDeserializationSchema.RMQCollector<T>
Special collector for RMQ messages.
|
Modifier and Type | Method and Description |
---|---|
void |
deserialize(com.rabbitmq.client.Envelope envelope,
com.rabbitmq.client.AMQP.BasicProperties properties,
byte[] body,
RMQDeserializationSchema.RMQCollector<T> collector)
This method takes all the RabbitMQ delivery information supplied by the client extract the
data and pass it to the collector.
|
boolean |
isEndOfStream(T nextElement)
Method to decide whether the element signals the end of the stream.
|
default void |
open(DeserializationSchema.InitializationContext context)
Initialization method for the schema.
|
getProducedType
default void open(DeserializationSchema.InitializationContext context) throws Exception
deserialize(com.rabbitmq.client.Envelope, com.rabbitmq.client.AMQP.BasicProperties, byte[], org.apache.flink.streaming.connectors.rabbitmq.RMQDeserializationSchema.RMQCollector<T>)
and thus suitable for one time setup work.
The provided DeserializationSchema.InitializationContext
can be used to access
additional features such as e.g. registering user metrics.
context
- Contextual information that can be used during initialization.Exception
void deserialize(com.rabbitmq.client.Envelope envelope, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] body, RMQDeserializationSchema.RMQCollector<T> collector) throws IOException
NOTICE: The implementation of this method can call RMQDeserializationSchema.RMQCollector.setMessageIdentifiers(java.lang.String, long)
with a custom correlation ID and delivery tag if
checkpointing and useCorrelationID
were enabled in the constructor of RMQSource
.
envelope
- an AMQP Envelope
.properties
- the AMQP.BasicProperties
of the message.body
- the message itself as a byte array.collector
- the RMQDeserializationSchema.RMQCollector
that will collect the data.IOException
- When the body of the message can't be parsedboolean isEndOfStream(T nextElement)
nextElement
- The element to test for the end-of-stream signal.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.