Examples of subscribe()


Examples of org.servicemix.ws.notification.NotificationProducer.Subscribe()

            SubscribeDocument requestDoc = SubscribeDocument.Factory.newInstance();
            Subscribe subscribe = requestDoc.addNewSubscribe();
            subscribe.setTopicExpression( TopicExpressionConverter.toTopicExpression(topic) );
            subscribe.setUseNotify(true);
            subscribe.setConsumerReference(endpointReference);
            SubscribeResponseDocument reponse = p.Subscribe(requestDoc);
        } else {
            UnsubscribeDocument requestDoc = UnsubscribeDocument.Factory.newInstance();
            Unsubscribe unsubscribe = requestDoc.addNewUnsubscribe();           
        }
    }
View Full Code Here

Examples of org.servicemix.wspojo.notification.NotificationProducer.subscribe()

    // -------------------------------------------------------------------------
    protected void fireDemandChangeEvent(boolean inDemand) throws RemoteException, SubscribeCreationFailedFault,
            ResourceUnknownFault, TopicPathDialectUnknownFault {
        NotificationProducer producer = createPublisherNotificationProducer();
        if (inDemand) {
            producer.subscribe(publisherReference, topicConverter.toTopicExpression(topic), useNotify, precondition,
                    selector, subscriptionPolicy, terminationTime);
        }
        else {

            // TODO how to unsubscribe?
View Full Code Here

Examples of org.springframework.data.keyvalue.redis.connection.Subscription.subscribe()

        if (connection != null) {
          synchronized (localMonitor) {
            if (connection != null) {
              Subscription sub = connection.getSubscription();
              if (sub != null) {
                sub.subscribe(channels);
              }
            }
          }
        }
      }
View Full Code Here

Examples of org.springframework.integration.channel.DirectChannel.subscribe()


  public static void main (String[] args) throws Exception {
    ApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/gmail-imap-idle-config.xml");
    DirectChannel inputChannel = ac.getBean("receiveChannel", DirectChannel.class);
    inputChannel.subscribe(new MessageHandler() {
      public void handleMessage(Message<?> message) throws MessagingException {
        logger.info("Message: " + message);
      }
    });
  }
View Full Code Here

Examples of org.springframework.integration.channel.ExecutorChannel.subscribe()

        requestChannel.send(message);
      }
    });

    ExecutorChannel replyChannel = this.findOrCreateRequestReplyChannel("replier." + name);
    replyChannel.subscribe(new MessageHandler() {

      @Override
      public void handleMessage(Message<?> message) throws MessagingException {
        replies.send(message);
      }
View Full Code Here

Examples of org.springframework.integration.channel.PublishSubscribeChannel.subscribe()

public class ThroughputSampleIntegrationTests {

  @Test
  public void logsThroughputWhenControlMessagesReceived() {
    PublishSubscribeChannel pubsub = new PublishSubscribeChannel();
    pubsub.subscribe(new ThroughputSamplerMessageHandler());

    int msgs = 100000;
    pubsub.send(new GenericMessage<String>("START"));
    for (int i = 0; i < msgs; i++) {
      pubsub.send(new GenericMessage<Object>(new Object()));
View Full Code Here

Examples of org.springframework.integration.core.SubscribableChannel.subscribe()

            log.debug("no overriding/existing channel found " + be.getMessage());

            channel = findOrCreateChannel(channelName, listener);
        }

        channel.subscribe(_serviceActivatingHandler);

        if (bridgeChannel != channel) {
            synchronized (grailsListenerChannels) {
                grailsListenerChannels.put(listener, bridgeChannel == null ? channel : bridgeChannel);
            }
View Full Code Here

Examples of org.springframework.messaging.SubscribableChannel.subscribe()

    // add a listener to this channel, otherwise there is not one defined
    // the reason we use a listener here is so we can assert truths on the
    // message and/or payload
    SubscribableChannel channel = (SubscribableChannel) incomingServerChannel;
    channel.subscribe(new AbstractReplyProducingMessageHandler() {

      @Override
      protected Object handleRequestMessage(Message<?> requestMessage) {
        byte[] payload = (byte[]) requestMessage.getPayload();
View Full Code Here

Examples of org.springframework.messaging.support.ExecutorSubscribableChannel.subscribe()

  @Test
  public void sendAndReceive() {

    SubscribableChannel channel = new ExecutorSubscribableChannel(this.executor);
    channel.subscribe(new MessageHandler() {
      @Override
      public void handleMessage(Message<?> message) throws MessagingException {
        MessageChannel replyChannel = (MessageChannel) message.getHeaders().getReplyChannel();
        replyChannel.send(new GenericMessage<String>("response"));
      }
View Full Code Here

Examples of org.syncany.operations.watch.NotificationListener.subscribe()

    // Start
    notificationListener1.start();
    notificationListener2.start();
   
    notificationListener1.subscribe(randomChannelName);
    notificationListener2.subscribe(randomChannelName);
       
    Thread.sleep(1500); // Let them settle
   
    notificationListener1.announce(randomChannelName, "Message from 1");
    notificationListener2.announce(randomChannelName, "Message from 2");
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.