Class ProtonUtils
java.lang.Object
org.springframework.amqp.client.ProtonUtils
Utility methods between ProtonJ and Spring API.
- Since:
- 4.1
- Author:
- Artem Bilan
-
Method Summary
Modifier and TypeMethodDescriptionstatic MessagefromProtonMessage(org.apache.qpid.protonj2.client.Message<?> message) Convert a ProtonJ message to the Spring AMQP message.static AmqpExceptionWrap an exception to anAmqpExceptionimplementation.static AmqpExceptionWrap anExecutionExceptionto anAmqpExceptionimplementation.static AmqpExceptiontoAmqpException(org.apache.qpid.protonj2.client.exceptions.ClientException ex) Wrap anClientExceptionto anAmqpExceptionimplementation.static org.apache.qpid.protonj2.client.Message<?> toProtonMessage(Message message) Convert a Spring AMQP message to a ProtonJ message.static <T> Supplier<T> toSupplier(Future<T> future, long timeout)
-
Method Details
-
toProtonMessage
Convert a Spring AMQP message to a ProtonJ message.- Parameters:
message- the Spring AMQP message to convert from.- Returns:
- the ProtonJ message based on the provided Spring AMQP message.
-
fromProtonMessage
Convert a ProtonJ message to the Spring AMQP message. Only messages with binary body are supported.- Parameters:
message- the ProtonJ message to convert from.- Returns:
- the Spring AMQP message based on the provided ProtonJ message.
-
toSupplier
-
toAmqpException
Wrap an exception to anAmqpExceptionimplementation.- Parameters:
ex- the exception from Proton client to wrap.- Returns:
- the
AmqpExceptionimplementation.
-
toAmqpException
Wrap anExecutionExceptionto anAmqpExceptionimplementation.- Parameters:
ex- the exception from Proton client to wrap.- Returns:
- the
AmqpExceptionimplementation.
-
toAmqpException
public static AmqpException toAmqpException(org.apache.qpid.protonj2.client.exceptions.ClientException ex) Wrap anClientExceptionto anAmqpExceptionimplementation.- Parameters:
ex- the exception from Proton client to wrap.- Returns:
- the
AmqpExceptionimplementation.
-