Examples of JMSConnectionInfo


Examples of org.apache.oozie.jms.JMSConnectionInfo

        HCatAccessorService hcatService = Services.get().get(HCatAccessorService.class);
        JMSAccessorService jmsService = Services.get().get(JMSAccessorService.class);

        String publisherAuthority = "hcat.server.com:5080";
        String topic = "topic.topic1";
        JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcat.server.com:8020"));
        jmsService.registerForNotification(connInfo, topic, new HCatMessageHandler(publisherAuthority));
        assertFalse(jmsService.isListeningToTopic(connInfo, topic));
        assertTrue(jmsService.isConnectionInRetryList(connInfo));
        assertTrue(jmsService.isTopicInRetryList(connInfo, topic));
        // Start the broker and check if listening to topic now
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

        String topic = "topic.topic1";
        // Start the broker
        BrokerService broker = new BrokerService();
        broker.addConnector(brokerURL);
        broker.start();
        JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcat.server.com:8020"));
        jmsService.registerForNotification(connInfo, topic, new HCatMessageHandler(publisherAuthority));
        assertTrue(jmsService.isListeningToTopic(connInfo, topic));
        assertFalse(jmsService.isConnectionInRetryList(connInfo));
        assertFalse(jmsService.isTopicInRetryList(connInfo, topic));
        ConnectionContext connCtxt = jmsService.createConnectionContext(connInfo);
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

        HCatAccessorService hcatService = Services.get().get(HCatAccessorService.class);
        JMSAccessorService jmsService = Services.get().get(JMSAccessorService.class);

        String publisherAuthority = "hcat.server.com:5080";
        String topic = "topic.topic1";
        JMSConnectionInfo connInfo = hcatService.getJMSConnectionInfo(new URI("hcat://hcat.server.com:8020"));
        jmsService.registerForNotification(connInfo, topic, new HCatMessageHandler(publisherAuthority));
        assertTrue(jmsService.isConnectionInRetryList(connInfo));
        assertTrue(jmsService.isTopicInRetryList(connInfo, topic));
        assertFalse(jmsService.isListeningToTopic(connInfo, topic));
        Thread.sleep(1100);
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

    }

    private ConnectionContext getConnectionContext() {
        Configuration conf = services.getConf();
        String jmsProps = conf.get(JMSJobEventListener.JMS_CONNECTION_PROPERTIES);
        JMSConnectionInfo connInfo = new JMSConnectionInfo(jmsProps);
        JMSAccessorService jmsService = Services.get().get(JMSAccessorService.class);
        ConnectionContext jmsContext = jmsService.createProducerConnectionContext(connInfo);
        return jmsContext;

    }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

            for (String connection : connections) {
                String[] values = connection.split("=", 2);
                String key = values[0].trim();
                String value = values[1].trim();
                if (key.equals("default")) {
                    defaultJMSConnInfo = new JMSConnectionInfo(value);
                }
                else {
                    mappingRules.add(new MappingRule(key, value));
                }
            }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

    public boolean isKnownPublisher(URI sourceURI) {
        if (nonJMSPublishers.contains(sourceURI.getAuthority())) {
            return true;
        }
        else {
            JMSConnectionInfo connInfo = publisherJMSConnInfoMap.get(sourceURI.getAuthority());
            return connInfo == null ? (getJMSConnectionInfo(sourceURI) != null) : true;
        }
    }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

     * @param publisherURI URI of the publisher
     * @return JMSConnectionInfo to connect to the JMS server that the publisher publishes to
     */
    public JMSConnectionInfo getJMSConnectionInfo(URI publisherURI) {
        String publisherAuthority = publisherURI.getAuthority();
        JMSConnectionInfo connInfo = null;
        if (publisherJMSConnInfoMap.containsKey(publisherAuthority)) {
            connInfo = publisherJMSConnInfoMap.get(publisherAuthority);
        }
        else {
            String schemeWithAuthority = publisherURI.getScheme() + "://" + publisherAuthority;
            for (MappingRule mr : mappingRules) {
                String jndiPropertiesString = mr.applyRule(schemeWithAuthority);
                if (jndiPropertiesString != null) {
                    connInfo = new JMSConnectionInfo(jndiPropertiesString);
                    publisherJMSConnInfoMap.put(publisherAuthority, connInfo);
                    LOG.info("Adding hcat server [{0}] to the list of JMS publishers", schemeWithAuthority);
                    break;
                }
            }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

     * @param hcatURI hcatalog partition URI
     * @param topic JMS topic to register to
     * @param msgHandler Handler which will process the messages received on the topic
     */
    public void registerForNotification(HCatURI hcatURI, String topic, HCatMessageHandler msgHandler) {
        JMSConnectionInfo connInfo = getJMSConnectionInfo(hcatURI.getURI());
        jmsService.registerForNotification(connInfo, topic, msgHandler);
        registeredTopicsMap.put(
                getKeyForRegisteredTopicsMap(hcatURI), topic);
    }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

    }

    public void unregisterFromNotification(HCatURI hcatURI) {
        String topic = registeredTopicsMap.remove(getKeyForRegisteredTopicsMap(hcatURI));
        if (topic != null) {
            JMSConnectionInfo connInfo = getJMSConnectionInfo(hcatURI.getURI());
            jmsService.unregisterFromNotification(connInfo, topic);
        }
    }
View Full Code Here

Examples of org.apache.oozie.jms.JMSConnectionInfo

    public void unregisterFromNotification(String server, String database, String table) {
        String key = server + DELIMITER + database + DELIMITER + table;
        String topic = registeredTopicsMap.remove(key);
        if (topic != null) {
            try {
                JMSConnectionInfo connInfo = getJMSConnectionInfo(new URI("hcat://" + server));
                jmsService.unregisterFromNotification(connInfo, topic);
            }
            catch (URISyntaxException e) {
                LOG.warn("Error unregistering from notification for topic [{0}]. Hcat table=[{1}]", topic, key, e);
            }
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.