Somebody helps me with code example of proper using oracle.tip.adapter.jms.JmsConnectionFactory
.
This is connection factory for using JMS through JMSAdapter in Weblogic 12C.
Weblogic 12С connected to standalone ActiveMQ server through JMSAdapter. In JMSAdapter I created new outbound connection with jndi eis/ext/open under oracle.tip.adapter.jms.IJmsConnectionFactory (interface) with properties:
AcknowledgeMode = AUTO_ACKNOWLEDGE
ConnectionFactoryLocation = org.apache.activemq.ActiveMQConnectionFactory
FactoryProperties = BrockerURL=tcp://host:port;ThirdPartyJMSProvider=true
public class CustomJMSSelector {
private final static String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
private final static String JMS_FACTORY="eis/ext/open";
private static JmsConnectionFactory jmsConnectionFactory;
public static byte[] customSelectorConsumer(String correlationId) throws NamingException, ResourceException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
Context ctx = new InitialContext(env);
jmsConnectionFactory = (JmsConnectionFactory) ctx.lookup(JMS_FACTORY);
I need to create session, consumer and consume message from queue using oracle.tip.adapter.jms.JmsConnectionFactory
.
Unfortunately, oracle.tip.adapter.jms.JmsConnectionFactory doesn't implement javax.jms.ConnectionFactory. It implements oracle.tip.adapter.jms.IJmsConnectionFactory that extends oracle.tip.adapter.api.OracleConnectionFactory. I tried cast to javax.jms.Connection or to org.apache.activemq.ActiveMQConnectionFactory but got class cast exception. This connection is using by osb (proxy service, business service)