Package com.rabbitmq.tools.jsonrpc

Examples of com.rabbitmq.tools.jsonrpc.JsonRpcServer


            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,
                                  new HelloJsonService() {
                                      public String greeting(String name) {
                                          return "Hello, "+name+", from JSON-RPC over AMQP!";
                                      }
                                      public int sum(java.util.List<Integer> args) {
                                          int s = 0;
                                          for (int i: args) { s += i; }
                                          return s;
                                      }
                                  });
            server.mainloop();
        } catch (Exception ex) {
            System.err.println("Main thread caught exception: " + ex);
            ex.printStackTrace();
            System.exit(1);
        }
View Full Code Here


            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,
                                  new HelloJsonService() {
                                      public String greeting(String name) {
                                          return "Hello, "+name+", from JSON-RPC over AMQP!";
                                      }
                                      public int sum(java.util.List<Integer> args) {
                                          int s = 0;
                                          for (int i: args) { s += i; }
                                          return s;
                                      }
                                  });
            server.mainloop();
        } catch (Exception ex) {
            System.err.println("Main thread caught exception: " + ex);
            ex.printStackTrace();
            System.exit(1);
        }
View Full Code Here

TOP

Related Classes of com.rabbitmq.tools.jsonrpc.JsonRpcServer

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.