public final class JmsCommons extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
EXAMPLE_CONTENT_TYPE |
static String |
EXAMPLE_ENCODING |
static String |
QUEUE |
static String |
TOPIC |
| Constructor and Description |
|---|
JmsCommons() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(AutoCloseable closable)
Closes
this Connection resource without throwing an exception (an error message is logged instead) |
static JmsSession |
createJmsSession(JmsConnection jmsConnection,
InternalAckMode ackMode,
boolean isTopic,
JmsSessionManager jmsSessionManager,
org.mule.runtime.extension.api.tx.OperationTransactionalAction transactionalAction)
Utility method to create new
JmsSession from a given JmsConnection |
static void |
evaluateMessageAck(InternalAckMode ackMode,
JmsSession session,
javax.jms.Message receivedMessage,
JmsSessionManager messageSessionManager,
JmsListenerLock jmsLock,
JmsMessageAckedMonitor jmsMessageAckedMonitor) |
static String |
getDestinationType(ConsumerType consumerType) |
static String |
getDestinationType(javax.jms.Destination consumerType) |
static String |
getDestinationType(DestinationTypeDescriptor consumerType) |
static boolean |
isManualAck(JmsSession session)
Verifies if the given session ACK Mode is
AckMode.MANUAL |
static boolean |
isPartOfCurrentTx(JmsSession session,
JmsConnection jmsConnection,
JmsSessionManager sessionManager)
Verifies if the given session is part of the current TX.
|
static void |
releaseResources(JmsSession session,
boolean isPartOfCurrentTx,
AutoCloseable... closeables)
Releases all the resources that are required to close.
|
static String |
resolveMessageContentType(javax.jms.Message message,
String defaultType) |
static String |
resolveMessageEncoding(javax.jms.Message message,
String defaultType) |
static <T> T |
resolveOverride(T configValue,
T operationValue) |
static void |
stopQuietly(Object stoppable)
Stops
this Stoppable resource without throwing an exception (an error message is logged instead) |
static InternalAckMode |
toInternalAckMode(JmsAckMode jmsAckMode) |
public static final String TOPIC
public static final String QUEUE
public static final String EXAMPLE_ENCODING
public static final String EXAMPLE_CONTENT_TYPE
public static String resolveMessageContentType(javax.jms.Message message, String defaultType)
public static String resolveMessageEncoding(javax.jms.Message message, String defaultType)
public static <T> T resolveOverride(T configValue,
T operationValue)
public static void evaluateMessageAck(InternalAckMode ackMode, JmsSession session, javax.jms.Message receivedMessage, JmsSessionManager messageSessionManager, JmsListenerLock jmsLock, JmsMessageAckedMonitor jmsMessageAckedMonitor) throws JmsAckException
JmsAckExceptionpublic static JmsSession createJmsSession(JmsConnection jmsConnection, InternalAckMode ackMode, boolean isTopic, JmsSessionManager jmsSessionManager, org.mule.runtime.extension.api.tx.OperationTransactionalAction transactionalAction) throws javax.jms.JMSException
JmsSession from a given JmsConnectionjmsConnection - the connection from where create a new JmsSessionackMode - the InternalAckMode to useisTopic - Indicates if the destination is whether a topic or a queuejmsSessionManager - JmsSessionManager to retrieve information about the current transaction statusJmsSession from the given JmsConnectionjavax.jms.JMSException - If an error happens creating a new JmsSessionpublic static InternalAckMode toInternalAckMode(JmsAckMode jmsAckMode)
public static void releaseResources(JmsSession session, boolean isPartOfCurrentTx, AutoCloseable... closeables)
session - Session to closecloseables - All the things that can be closedpublic static boolean isManualAck(JmsSession session)
AckMode.MANUALpublic static boolean isPartOfCurrentTx(JmsSession session, JmsConnection jmsConnection, JmsSessionManager sessionManager)
public static void closeQuietly(AutoCloseable closable)
this Connection resource without throwing an exception (an error message is logged instead)closable - the resource to closepublic static void stopQuietly(Object stoppable)
this Stoppable resource without throwing an exception (an error message is logged instead)stoppable - the resource to stoppublic static String getDestinationType(ConsumerType consumerType)
public static String getDestinationType(DestinationTypeDescriptor consumerType)
public static String getDestinationType(javax.jms.Destination consumerType)
Copyright © 2022. All rights reserved.