Examples of JMSConnectionInfo


Examples of org.apache.oozie.client.JMSConnectionInfo

        return json;
    }

    public void testParseJMSInfo() {
        JSONObject json = createJMSInfoJSONObject();
        JMSConnectionInfo jmsDetails = JsonToBean.createJMSConnectionInfo(json);
        assertEquals("topicPrefix", jmsDetails.getTopicPrefix());
        assertEquals("wfTopic", jmsDetails.getTopicPattern(AppType.WORKFLOW_JOB));
        assertEquals("wfTopic", jmsDetails.getTopicPattern(AppType.WORKFLOW_ACTION));
        assertEquals("coordTopic", jmsDetails.getTopicPattern(AppType.COORDINATOR_ACTION));
        Properties jmsProps = jmsDetails.getJNDIProperties();
        assertNotNull(jmsDetails.getJNDIProperties());
        assertEquals("v1", jmsProps.get("k1"));
        assertEquals("v2", jmsProps.get("k2"));

    }
View Full Code Here

Examples of org.apache.oozie.client.JMSConnectionInfo

    public static JMSConnectionInfo createJMSConnectionInfo(JSONObject json) {
        final JMSConnectionInfoWrapper jmsInfo = (JMSConnectionInfoWrapper) Proxy.newProxyInstance(
                JsonToBean.class.getClassLoader(), new Class[] { JMSConnectionInfoWrapper.class },
                new JsonInvocationHandler(JMS_CONNECTION_INFO, json));

        return new JMSConnectionInfo() {
            @Override
            public String getTopicPrefix() {
                return jmsInfo.getTopicPrefix();
            }
View Full Code Here

Examples of org.apache.oozie.client.JMSConnectionInfo

    public static JMSConnectionInfo createJMSConnectionInfo(JSONObject json) {
        final JMSConnectionInfoWrapper jmsInfo = (JMSConnectionInfoWrapper) Proxy.newProxyInstance(
                JsonToBean.class.getClassLoader(), new Class[] { JMSConnectionInfoWrapper.class },
                new JsonInvocationHandler(JMS_CONNECTION_INFO, json));

        return new JMSConnectionInfo() {
            @Override
            public String getTopicPrefix() {
                return jmsInfo.getTopicPrefix();
            }
View Full Code Here

Examples of org.apache.oozie.client.JMSConnectionInfo

        return json;
    }

    public void testParseJMSInfo() {
        JSONObject json = createJMSInfoJSONObject();
        JMSConnectionInfo jmsDetails = JsonToBean.createJMSConnectionInfo(json);
        assertEquals("topicPrefix", jmsDetails.getTopicPrefix());
        assertEquals("wfTopic", jmsDetails.getTopicPattern(AppType.WORKFLOW_JOB));
        assertEquals("wfTopic", jmsDetails.getTopicPattern(AppType.WORKFLOW_ACTION));
        assertEquals("coordTopic", jmsDetails.getTopicPattern(AppType.COORDINATOR_ACTION));
        Properties jmsProps = jmsDetails.getJNDIProperties();
        assertNotNull(jmsDetails.getJNDIProperties());
        assertEquals("v1", jmsProps.get("k1"));
        assertEquals("v2", jmsProps.get("k2"));

    }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

        conf.set(HCatAccessorService.JMS_CONNECTIONS_PROPERTIES, jmsConnectionURL);
        services.init();

        HCatAccessorService hcatService = services.get(HCatAccessorService.class);
        // No default JMS mapping
        JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("http://unknown:9999/fs"));
        assertNull(connInfo);
        connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://server1.colo1.server.com:8020/db/table/pk1=val1;pk2=val2"));
        assertEquals("java.naming.factory.initial#Dummy.Factory;java.naming.provider.url#tcp://broker.colo1:61616",
                connInfo.getJNDIPropertiesString());
        connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://xyz.corp.dummy.com/db/table"));
        assertEquals("java.naming.factory.initial#Dummy.Factory;java.naming.provider.url#tcp:localhost:61616",
                connInfo.getJNDIPropertiesString());
    }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

        String jmsConnectionURL = server1 + "," + server2 + "," + server3;
        conf.set(HCatAccessorService.JMS_CONNECTIONS_PROPERTIES, jmsConnectionURL);
        services.init();

        HCatAccessorService hcatService = services.get(HCatAccessorService.class);
        JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcatserver.blue.server.com:8020"));
        // rules will be applied
        assertEquals("java.naming.factory.initial#Dummy.Factory;java.naming.provider.url#tcp://broker.blue:61616",
                connInfo.getJNDIPropertiesString());

        connInfo = hcatService.getJMSConnectionInfo(new URI("http://unknown:9999/fs"));
        // will map to default
        assertEquals(
                "java.naming.factory.initial#org.apache.activemq.jndi.ActiveMQInitialContextFactory;" +
                "java.naming.provider.url#vm://localhost?broker.persistent=false",
                connInfo.getJNDIPropertiesString());

        connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://xyz.corp.dummy.com"));
        assertEquals("java.naming.factory.initial#Dummy.Factory;java.naming.provider.url#tcp:localhost:61616",
                connInfo.getJNDIPropertiesString());
    }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

    @Test
    public void testConnection() throws Exception {
        HCatAccessorService hcatService = services.get(HCatAccessorService.class);
        JMSAccessorService jmsService = services.get(JMSAccessorService.class);
        // both servers should connect to default JMS server
        JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcatserver.blue.server.com:8020"));
        ConnectionContext ctxt1 = jmsService.createConnectionContext(connInfo);
        assertTrue(ctxt1.isConnectionInitialized());
        JMSConnectionInfo connInfo1 = hcatService.getJMSConnectionInfo(new URI("http://unknown:80"));
        ConnectionContext ctxt2 = jmsService.createConnectionContext(connInfo1);
        assertTrue(ctxt2.isConnectionInitialized());
        assertEquals(ctxt1, ctxt2);
        ctxt1.close();
    }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

            HCatAccessorService hcatService = services.get(HCatAccessorService.class);
            JMSAccessorService jmsService = services.get(JMSAccessorService.class);
            String server = "hcat.server.com:5080";
            String topic = "hcat.mydb.mytable";

            JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcat.server.com:8020"));
            jmsService.registerForNotification(connInfo, topic, new HCatMessageHandler(server));

            MessageReceiver receiver1 = jmsService.getMessageReceiver(connInfo, topic);
            jmsService.registerForNotification(connInfo, topic, new HCatMessageHandler(server));
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

            HCatAccessorService hcatService = services.get(HCatAccessorService.class);
            JMSAccessorService jmsService = services.get(JMSAccessorService.class);
            String server = "hcat.server.com:5080";
            String topic = "hcatalog.mydb.mytable";

            JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcat.server.com:8020"));
            jmsService.registerForNotification(connInfo, topic, new HCatMessageHandler(server));

            MessageReceiver receiver1 = jmsService.getMessageReceiver(connInfo, topic);
            assertNotNull(receiver1);
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

                    ";java.naming.provider.url#vm://localhost?broker.persistent=false;" +
                    "connectionFactoryNames#dynamicFactories/hcat.prod.${1}";
            conf.set(HCatAccessorService.JMS_CONNECTIONS_PROPERTIES, jmsURL);
            services.init();
            HCatAccessorService hcatService = services.get(HCatAccessorService.class);
            JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcatserver.blue.server.com:8020"));
            assertEquals(
                    "java.naming.factory.initial#org.apache.activemq.jndi.ActiveMQInitialContextFactory;java.naming.provider.url#" +
                    "vm://localhost?broker.persistent=false;connectionFactoryNames#dynamicFactories/hcat.prod.hcatserver",
                    connInfo.getJNDIPropertiesString());

            ConnectionContext ctx1 = new DefaultConnectionContext();
            ctx1.createConnection(connInfo.getJNDIProperties());
            BrokerService broker = new BrokerService();
            // Without this stop testConnectionRetry fails with
            // javax.management.InstanceAlreadyExistsException: org.apache.activemq:BrokerName=localhost,Type=Broker
            broker.stop();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.