Package org.apache.airavata.wsmg.client

Examples of org.apache.airavata.wsmg.client.WseMsgBrokerClient.subscribe()


        "http://localhost:2222/axis2/services/ConsumerService");

    WseMsgBrokerClient client = new WseMsgBrokerClient();
    client.init(brokerLocation);
    // create a topic subscription.
    String subscriptionId = client.subscribe(consumerLocation,
        topicExpression, null);

    System.out.println("subscription id : " + subscriptionId);
  }
}
View Full Code Here


      return;
    }

    try {

      subscriptionId = client.subscribe(consumerEprs[0], null,
          xpathExpression);
      System.out.println(getName() + "got the subscription id :"
          + subscriptionId);

    } catch (MsgBrokerClientException e) {
View Full Code Here

        api.init(BROKER_URL);
        int consumerPort = 5555;

        String[] consumerServiceEprs = api.startConsumerService(consumerPort, handler);

        api.subscribe(consumerServiceEprs[0], ">", null);

        String topic = "Foo";
        // if remote broker location specified, use WSMessaging publisher;
        ConstructorProps props = ConstructorProps
                .newProps(ConstructorConsts.ENABLE_ASYNC_PUBLISH, "false")
View Full Code Here

      return;
    }

    try {

      subscriptionId = client.subscribe(consumerEprs[0], topicExpression,
          null);
    } catch (MsgBrokerClientException e) {

      e.printStackTrace();
View Full Code Here

      return;
    }

    try {

      subscriptionId = client.subscribe(consumerEprs[0], null,
          xpathExpression);
      System.out.println(getName() + "got the subscription id :"
          + subscriptionId);

    } catch (MsgBrokerClientException e) {
View Full Code Here

        WseMsgBrokerClient wseClient = new WseMsgBrokerClient();
        wseClient.init(brokerLoc);
        logger.debug("Starting Subscription for topic [" + topic + "]at the broker location:" + brokerLoc);
        ConsumerServer xs = new ConsumerServer(consumerServerPort, this);
        xs.start();
        String subscriptionId = wseClient.subscribe(xs.getConsumerServiceEPRs()[0], topic, null);
        logger.debug("The consumer server started on EPR" + xs.getConsumerServiceEPRs()[0]);
        Subscription subscription = new Subscription(xs, subscriptionId, topic, callback, brokerLoc);
        return subscription;
    }
View Full Code Here

            WseMsgBrokerClient topicOnlyReceiverApi = new WseMsgBrokerClient();
            topicOnlyReceiverApi.init(brokerEpr);
            NotificationReciever topicOnlyMsgReceiver = new NotificationReciever("Topic Only");
            String[] topicConsumerEPRs = topicOnlyReceiverApi.startConsumerService(consumerPort, topicOnlyMsgReceiver);
            assertTrue("invalid consumer eprs returned", topicConsumerEPRs.length > 0);
            String topicOnlySubId = topicOnlyReceiverApi.subscribe(topicConsumerEPRs[0], topic, null);
            System.out.println("Topic only subscription ID: " + topicOnlySubId);

            WseMsgBrokerClient xpathAndTopicReceiverApi = new WseMsgBrokerClient();
            xpathAndTopicReceiverApi.init(brokerEpr);
            NotificationReciever topicAndXpathMsgReceiver = new NotificationReciever("Topic And Xpath");
View Full Code Here

            xpathAndTopicReceiverApi.init(brokerEpr);
            NotificationReciever topicAndXpathMsgReceiver = new NotificationReciever("Topic And Xpath");
            String[] topicAndXpathConsumerEPRs = xpathAndTopicReceiverApi.startConsumerService(consumerPort + 1,
                    topicAndXpathMsgReceiver);
            assertTrue("invalid consumer eprs returned", topicAndXpathConsumerEPRs.length > 0);
            String topicAndXpathSubId = xpathAndTopicReceiverApi.subscribe(topicAndXpathConsumerEPRs[0], topic,
                    xpathExpression);
            System.out.println("Xpath and Topic subscription ID: " + topicAndXpathSubId);

            WseMsgBrokerClient senderApi = new WseMsgBrokerClient();
            senderApi.init(brokerEpr);
View Full Code Here

            assertTrue(consumerEPRs.length > 0);

            String xpathExpression = "/c/b/a";
            String topicExpression = "XpathAndTopicTestWse";

            String subscriptionID = wseMsgBrokerClient.subscribe(consumerEPRs[0], topicExpression, xpathExpression);

            try {

                wseMsgBrokerClient.publish(topicExpression, AXIOMUtil.stringToOM(validMsg));
                wseMsgBrokerClient.publish(topicExpression, AXIOMUtil.stringToOM(invalidMsg));
View Full Code Here

            assertTrue(consumerEPRs.length > 0);

            String xpathExpression = "/c/b/a";

            String subscriptionID = msgBrokerClient.subscribe(consumerEPRs[0], null, xpathExpression);

            try {
                msgBrokerClient.publish(null, AXIOMUtil.stringToOM(validMsg));
                msgBrokerClient.publish(null, AXIOMUtil.stringToOM(invalidMsg));
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.