@ProviderType public class MessageToSDTMapConverter extends Object implements com.solace.messaging.util.internal.SolaceTypeConverter.MessageToSolaceType<SolaceSDTMap>, Converter.BytesToObject<SolaceSDTMap>
MessageToSDTMapConverter
with the InboundMessage#getAndConvertPayload(BytesToObject, Class)
.
final MessagingService service; //Assuming service instance is initialized
final DirectMessageReceiver receiver = service
.createDirectMessageReceiverBuilder()
.withSubscriptions(TopicSubscription.of("some/topic"))
.build().start();
final SolaceSDTMap map = receiver.receiveMessage()
.getAndConvertPayload(new MessageToSDTMapConverter(), SolaceSDTMap.class);
For corresponding publisher sample refer to the SolaceSDTMapToMessageConverter
Converter.BytesToObject<T extends Serializable>, Converter.ObjectToBytes<T extends Serializable>
Constructor and Description |
---|
MessageToSDTMapConverter() |
Modifier and Type | Method and Description |
---|---|
SolaceSDTMap |
convert(byte[] src)
Converts the provided byte-array to the specified type.
|
SolaceSDTMap |
get(com.solacesystems.jcsmp.BytesXMLMessage message) |
public SolaceSDTMap convert(byte[] src) throws PubSubPlusClientException.IncompatibleMessageException
Converter.BytesToObject
convert
in interface Converter.BytesToObject<SolaceSDTMap>
src
- a byte-array; a null
check on this parameter is required in the
implementation of this methodPubSubPlusClientException.IncompatibleMessageException
- if an incompatible message payload is foundpublic SolaceSDTMap get(com.solacesystems.jcsmp.BytesXMLMessage message) throws PubSubPlusClientException.IncompatibleMessageException
get
in interface com.solace.messaging.util.internal.SolaceTypeConverter.MessageToSolaceType<SolaceSDTMap>
PubSubPlusClientException.IncompatibleMessageException
Copyright 2019-2024 Solace Corporation. All rights reserved.