Package com.datastax.oss.pulsar.jms
Class Utils
java.lang.Object
com.datastax.oss.pulsar.jms.Utils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionbuildConfigurationOverride(PulsarDestination destination) static voidcheckNotOnMessageListener(PulsarSession session) static voidcheckNotOnMessageProducer(PulsarSession session, com.datastax.oss.pulsar.jms.PulsarMessageProducer producer) static voidcheckNotOnSessionCallback(PulsarSession session) static com.datastax.oss.pulsar.jms.ConsumerConfigurationcomputeConsumerOverrideConfiguration(PulsarDestination destination) deepCopyMap(Map<String, Object> configuration) static ObjectdeepCopyObject(Object value) static voidexecuteCompletionListenerInSessionContext(PulsarSession session, com.datastax.oss.pulsar.jms.PulsarMessageProducer producer, Runnable code) static booleanexecuteMessageListenerInSessionContext(PulsarSession session, PulsarMessageConsumer consumer, BooleanSupplier code) static <T> Tget(CompletableFuture<T> future) static Stringstatic javax.jms.JMSExceptionhandleException(Throwable cause) static voidstatic <T> Tinvoke(Utils.SupplierWithException<T> code) static booleanisOnMessageListener(PulsarSession session, PulsarMessageConsumer consumer) static intmapPriorityToPartition(int priority, int numPartitions, boolean linear) Map the JMS Priority to a partition.static voidstatic <T> Tstatic voidstatic <T> Tstatic booleansameEntryId(org.apache.pulsar.client.api.MessageId a, org.apache.pulsar.client.api.MessageId b)
-
Method Details
-
handleException
-
get
- Throws:
javax.jms.JMSException
-
invoke
- Throws:
javax.jms.JMSException
-
invoke
- Throws:
javax.jms.JMSException
-
executeMessageListenerInSessionContext
public static boolean executeMessageListenerInSessionContext(PulsarSession session, PulsarMessageConsumer consumer, BooleanSupplier code) -
executeCompletionListenerInSessionContext
public static void executeCompletionListenerInSessionContext(PulsarSession session, com.datastax.oss.pulsar.jms.PulsarMessageProducer producer, Runnable code) -
isOnMessageListener
-
checkNotOnMessageListener
- Throws:
javax.jms.JMSException
-
checkNotOnSessionCallback
- Throws:
javax.jms.JMSException
-
checkNotOnMessageProducer
public static void checkNotOnMessageProducer(PulsarSession session, com.datastax.oss.pulsar.jms.PulsarMessageProducer producer) throws javax.jms.JMSException - Throws:
javax.jms.JMSException
-
noException
-
noException
-
runtimeException
-
runtimeException
-
deepCopyObject
-
deepCopyMap
-
getAndRemoveString
-
sameEntryId
public static boolean sameEntryId(org.apache.pulsar.client.api.MessageId a, org.apache.pulsar.client.api.MessageId b) -
mapPriorityToPartition
public static int mapPriorityToPartition(int priority, int numPartitions, boolean linear) Map the JMS Priority to a partition.- Parameters:
priority-numPartitions-- Returns:
- the partition id
-
buildConfigurationOverride
public static Map<String,Object> buildConfigurationOverride(PulsarDestination destination) throws javax.jms.InvalidDestinationException - Throws:
javax.jms.InvalidDestinationException
-
computeConsumerOverrideConfiguration
public static com.datastax.oss.pulsar.jms.ConsumerConfiguration computeConsumerOverrideConfiguration(PulsarDestination destination) throws javax.jms.InvalidDestinationException - Throws:
javax.jms.InvalidDestinationException
-