Examples of createChannel()


Examples of com.rabbitmq.client.Connection.createChannel()

    Connection connection = null;
    try {
      ConnectionFactory factory = new ConnectionFactory();
      factory.setHost(_mqServer);
      connection = factory.newConnection();
      Channel channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");
      String queueName = channel.queueDeclare().getQueue();

      String bindingKey = _partition;
View Full Code Here

Examples of com.rabbitmq.client.Connection.createChannel()

    System.out.println("Sending " + count + " messages with random topic id");

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost(mqServer);
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "topic");

    for (int i = 0; i < count; i++) {
      int rand = ((int) (Math.random() * 10000) % SetupConsumerCluster.DEFAULT_PARTITION_NUMBER);
View Full Code Here

Examples of com.rabbitmq.client.Connection.createChannel()

        ConnectionFactory cfconn = new ConnectionFactory();
        cfconn.setHost("localhost");
        cfconn.setPort(AMQP.PROTOCOL.PORT);
        Connection conn = cfconn.newConnection();

        Channel ch = conn.createChannel();
        ch.exchangeDeclare("elasticsearch", "direct", true);
        ch.queueDeclare("elasticsearch", true, false, false, null);

        String message = "{ \"index\" : { \"index\" : \"test\", \"type\" : \"type1\", \"id\" : \"1\" }\n" +
                "{ \"type1\" : { \"field1\" : \"value1\" } }\n" +
View Full Code Here

Examples of com.rabbitmq.client.Connection.createChannel()

    while (true) {
      attempts++;
      Logger.info("Attempting to connect to queue: attempt " + attempts);
      try {
        Connection connection = this.getConnection();
        channel = connection.createChannel();
        break;

      } catch (IOException e) {
        Logger.error("Error creating RabbitMQ channel, retrying in 5 secs - Exception: %s", ExceptionUtil.getStackTrace(e));
        try {
View Full Code Here

Examples of com.rabbitmq.client.impl.recovery.AutorecoveringConnection.createChannel()

    }

    public void testConnectionRecoveryWithDisabledTopologyRecovery() throws IOException, InterruptedException {
        AutorecoveringConnection c = newRecoveringConnection(true);
        Channel ch = c.createChannel();
        String q = "java-client.test.recovery.q2";
        ch.queueDeclare(q, false, true, false, null);
        ch.queueDeclarePassive(q);
        assertTrue(c.isOpen());
        try {
View Full Code Here

Examples of com.sun.sgs.app.ChannelManager.createChannel()

     */
    public void initialize(Properties props) {
        ChannelManager channelMgr = AppContext.getChannelManager();
       
        // Create and keep a reference to the first channel.
        Channel c1 = channelMgr.createChannel(CHANNEL_1_NAME,
                                              null,
                                              Delivery.RELIABLE);
        channel1 = AppContext.getDataManager().createReference(c1);
       
        // We don't keep a reference to the second channel, to demonstrate
View Full Code Here

Examples of com.sun.sgs.app.ChannelManager.createChannel()

        channel1 = AppContext.getDataManager().createReference(c1);
       
        // We don't keep a reference to the second channel, to demonstrate
        // looking it up by name when needed.  Also, this channel uses a
        // {@link ChannelListener} to filter messages.
        channelMgr.createChannel(CHANNEL_2_NAME,
                                 new HelloChannelsChannelListener(),
                                 Delivery.RELIABLE);
    }

    /**
 
View Full Code Here

Examples of com.sun.sgs.app.ChannelManager.createChannel()

     */
    protected void openChannel() {
        CellMO cell = cellRef.get();

        ChannelManager cm = AppContext.getChannelManager();
        Channel cellChannel = cm.createChannel("Cell "+cell.getCellID().toString(),
                                               null,
                                               Delivery.RELIABLE);

        DataManager dm = AppContext.getDataManager();
        cellChannelRef = dm.createReference(cellChannel);
View Full Code Here

Examples of com.sun.sgs.app.ChannelManager.createChannel()

            ChannelManager cm = AppContext.getChannelManager();
           
            ClientSessionSet sessions = new ClientSessionSet();
            String channelName = handler.getConnectionType().toString() +
                                 "(" + String.valueOf(assignID) + ")";
            Channel channel = cm.createChannel(channelName,
                                               null,
                                               Delivery.RELIABLE);

            // mark ourself for udate
            dm.markForUpdate(this);
View Full Code Here

Examples of de.nava.informa.core.ChannelBuilderIF.createChannel()

    super("TestChannelBuilder", testname);
  }

  public void testCreateChannel() {
    ChannelBuilderIF builder = new ChannelBuilder();
    ChannelIF chA = builder.createChannel("myChannel");
    assertEquals("myChannel", chA.getTitle());
  }

  public void testCreateItem() throws MalformedURLException {
    ChannelBuilderIF builder = new ChannelBuilder();
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.