Package org.xbib.elasticsearch.websocket.client

Examples of org.xbib.elasticsearch.websocket.client.WebSocketClientFactory.newClient()


            final WebSocketClientRequest publish = clientFactory.newRequest()
                    .type("publish").data(jsonBuilder().startObject()
                    .field("message", "Hello World")
                    .field("topic", topic).endObject());
           
            WebSocketClient client = clientFactory.newClient(getAddressOfNode("1"),
                    new WebSocketActionListener.Adapter() {
                        @Override
                        public void onConnect(WebSocketClient client) throws IOException {
                                logger.info("sending subscribe command, channel = {}", client.channel());
                                subscribe.send(client);
View Full Code Here


                    .type("publish").data(jsonBuilder().startObject()
                    .field("message", "Hi there, I'm another client")
                    .field("topic", topic).endObject());
           
            // open first client
            WebSocketClient subscribingClient = clientFactory.newClient(getAddressOfNode("1"),
                    new WebSocketActionListener.Adapter() {
                        @Override
                        public void onConnect(WebSocketClient client) {
                            try {
                                logger.info("sending subscribe command, channel {}", client.channel());
View Full Code Here

                        }

                    });
           
            // open two client
            WebSocketClient publishingClient = clientFactory.newClient(getAddressOfNode("1"),
                    new WebSocketActionListener.Adapter() {
                        @Override
                        public void onConnect(WebSocketClient client) {
                            try {
                                logger.info("sending publish command, channel = {}", client.channel());
View Full Code Here

     */
    @Test
    public void subscribeToOurselves() {
        try {
            WebSocketClientFactory clientFactory = new NettyWebSocketClientFactory();
            WebSocketClient client = clientFactory.newClient(getAddressOfNode("1"),
                    new WebSocketActionListener() {
                        @Override
                        public void onConnect(WebSocketClient client) {
                            try {
                                logger.info("sending subscribe command");
View Full Code Here

    @Test
    public void testBulk() {
        try {
            final WebSocketClientFactory clientFactory = new NettyWebSocketClientFactory();
            WebSocketClient client = clientFactory.newClient(
                    getAddressOfNode("1"),
                    new WebSocketActionListener.Adapter() {
                        @Override
                        public void onConnect(WebSocketClient client) {
                            try {
View Full Code Here

     */
    @Test
    public void helloWorld() {
        try {
            WebSocketClientFactory clientFactory = new NettyWebSocketClientFactory();
            WebSocketClient client = clientFactory.newClient(getAddressOfNode("1"),
                    new WebSocketActionListener() {
                        @Override
                        public void onConnect(WebSocketClient client) {
                            logger.info("web socket connected");
                            String s = "{\"Hello\":\"World\"}";
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.