Package com.rabbitmq.client

Examples of com.rabbitmq.client.ConnectionFactory


            String topicPrefix = (args.length > 1) ? args[1] : DEFAULT_TOPIC_PREFIX;
            String exchange = (args.length > 2) ? args[2] : null;
            String message = (args.length > 3) ? args[3] :
                "the time is " + new java.util.Date().toString();

            ConnectionFactory cfconn = new ConnectionFactory();
            cfconn.setUri(uri);
            Connection conn = cfconn.newConnection();

            Channel ch = conn.createChannel();

            if (exchange == null) {
                exchange = "amq.topic";
View Full Code Here


        assertEquals(vhost, cf.getVirtualHost());
    }

    private void parseFail(String uri) {
        try {
            (new ConnectionFactory()).setUri(uri);
            fail("URI parse didn't fail: '" + uri + "'");
        } catch (Exception e) {
            // whoosh!
        }
    }
View Full Code Here

            String uri = (args.length > 0) ? args[0] : "amqp://localhost";
            String topicPattern = (args.length > 1) ? args[1] : "#";
            String exchange = (args.length > 2) ? args[2] : null;
            String queue = (args.length > 3) ? args[3] : null;

            ConnectionFactory cfconn = new ConnectionFactory();
            cfconn.setUri(uri);
            Connection conn = cfconn.newConnection();

            final Channel channel = conn.createChannel();

            if (exchange == null) {
                exchange = "amq.topic";
View Full Code Here

public class HelloJsonServer {
    public static void main(String[] args) {
        try {
            String uri = (args.length > 0) ? args[0] : "amqp://localhost";

            ConnectionFactory connFactory = new ConnectionFactory();
            connFactory.setUri(uri);
            Connection conn = connFactory.newConnection();
            final Channel ch = conn.createChannel();

            ch.queueDeclare("Hello", false, false, false, null);
            JsonRpcServer server =
                new JsonRpcServer(ch, "Hello", HelloJsonService.class,
View Full Code Here

  public void run(){

    final Connection conn;
    try {
      conn = new ConnectionFactory()
          {{setUri(uri);}}.newConnection();
      Channel setup = conn.createChannel();

      setup.exchangeDeclare(EXCHANGE, "direct");
      setup.queueDeclare(QUEUE, false, false, false, null);
View Full Code Here

    public static void main(String[] args) {
        try {
            String uri = (args.length > 0) ? args[0] : "amqp://localhost";
            String exchange = (args.length > 1) ? args[1] : "amq.rabbitmq.log";

            ConnectionFactory cfconn = new ConnectionFactory();
            cfconn.setUri(uri);
            Connection conn = cfconn.newConnection();

            Channel ch1 = conn.createChannel();

            String queueName = ch1.queueDeclare().getQueue();
            ch1.queueBind(queueName, exchange, "#");
View Full Code Here

            connectionCount = Integer.parseInt(args[1]);
            channelPerConnectionCount = Integer.parseInt(args[2]);
            heartbeatInterval = Integer.parseInt(args[3]);
            rate = (args.length > 4) ? Double.parseDouble(args[4]) : 1.0;

            ConnectionFactory factory = new ConnectionFactory();
            factory.setRequestedHeartbeat(heartbeatInterval);
            for (int i = 0; i < connectionCount; i++) {
                System.out.println("Starting connection " + i);
                factory.setUri(uri);
                final Connection conn = factory.newConnection();

                for (int j = 0; j < channelPerConnectionCount; j++) {
                    final Channel ch = conn.createChannel();

                    final int threadNumber = i * channelPerConnectionCount + j;
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        myFrameHandler = new MyFrameHandler();
        factory = new ConnectionFactory();
    }
View Full Code Here

      if (!outputDir.exists() || !outputDir.isDirectory()) {
    System.err.println("Output directory must exist, and must be a directory.");
    System.exit(2);
      }

            ConnectionFactory connFactory = new ConnectionFactory();
            connFactory.setUri(uri);
            Connection conn = connFactory.newConnection();

            final Channel ch = conn.createChannel();

            String queueName =
    (requestedQueueName.equals("")
View Full Code Here

  };

  Connection connection;

  public void setUp() throws Exception{
    connection = new ConnectionFactory().newConnection();
  }
View Full Code Here

TOP

Related Classes of com.rabbitmq.client.ConnectionFactory

Copyright © 2018 www.massapicom. 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.