Package com.alibaba.otter.canal.protocol.CanalPacket

Examples of com.alibaba.otter.canal.protocol.CanalPacket.Unsub


                                         MessageFormatter.format("destination or clientId is null", sub.toString()).getMessage(),
                                         ctx.getChannel(), null);
                    }
                    break;
                case UNSUBSCRIPTION:
                    Unsub unsub = Unsub.parseFrom(packet.getBody());
                    if (StringUtils.isNotEmpty(unsub.getDestination()) && StringUtils.isNotEmpty(unsub.getClientId())) {
                        clientIdentity = new ClientIdentity(unsub.getDestination(), Short.valueOf(unsub.getClientId()),
                                                            unsub.getFilter());
                        MDC.put("destination", clientIdentity.getDestination());
                        embededServer.unsubscribe(clientIdentity);
                        stopCanalInstanceIfNecessary(clientIdentity);// 尝试关闭
                        NettyUtils.ack(ctx.getChannel(), null);
                    } else {
                        NettyUtils.error(401, MessageFormatter.format("destination or clientId is null",
                                                                      unsub.toString()).getMessage(), ctx.getChannel(),
                                         null);
                    }
                    break;
                case GET:
                    Get get = CanalPacket.Get.parseFrom(packet.getBody());
View Full Code Here


                                         MessageFormatter.format("destination or clientId is null", sub.toString()).getMessage(),
                                         ctx.getChannel(), null);
                    }
                    break;
                case UNSUBSCRIPTION:
                    Unsub unsub = Unsub.parseFrom(packet.getBody());
                    if (StringUtils.isNotEmpty(unsub.getDestination()) && StringUtils.isNotEmpty(unsub.getClientId())) {
                        clientIdentity = new ClientIdentity(unsub.getDestination(), Short.valueOf(unsub.getClientId()),
                                                            unsub.getFilter());
                        MDC.put("destination", clientIdentity.getDestination());
                        embededServer.unsubscribe(clientIdentity);
                        stopCanalInstanceIfNecessary(clientIdentity);// 尝试关闭
                        NettyUtils.ack(ctx.getChannel(), null);
                    } else {
                        NettyUtils.error(401,
                                         MessageFormatter.format("destination or clientId is null", unsub.toString()).getMessage(),
                                         ctx.getChannel(), null);
                    }
                    break;
                case GET:
                    Get get = CanalPacket.Get.parseFrom(packet.getBody());
View Full Code Here

                                         MessageFormatter.format("destination or clientId is null", sub.toString()).getMessage(),
                                         ctx.getChannel(), null);
                    }
                    break;
                case UNSUBSCRIPTION:
                    Unsub unsub = Unsub.parseFrom(packet.getBody());
                    if (StringUtils.isNotEmpty(unsub.getDestination()) && StringUtils.isNotEmpty(unsub.getClientId())) {
                        clientIdentity = new ClientIdentity(unsub.getDestination(), Short.valueOf(unsub.getClientId()),
                                                            unsub.getFilter());
                        MDC.put("destination", clientIdentity.getDestination());
                        embededServer.unsubscribe(clientIdentity);
                        stopCanalInstanceIfNecessary(clientIdentity);// 尝试关闭
                        NettyUtils.ack(ctx.getChannel(), null);
                    } else {
                        NettyUtils.error(401, MessageFormatter.format("destination or clientId is null",
                                                                      unsub.toString()).getMessage(), ctx.getChannel(),
                                         null);
                    }
                    break;
                case GET:
                    Get get = CanalPacket.Get.parseFrom(packet.getBody());
View Full Code Here

                                         MessageFormatter.format("destination or clientId is null", sub.toString()).getMessage(),
                                         ctx.getChannel(), null);
                    }
                    break;
                case UNSUBSCRIPTION:
                    Unsub unsub = Unsub.parseFrom(packet.getBody());
                    if (StringUtils.isNotEmpty(unsub.getDestination()) && StringUtils.isNotEmpty(unsub.getClientId())) {
                        clientIdentity = new ClientIdentity(unsub.getDestination(), Short.valueOf(unsub.getClientId()),
                                                            unsub.getFilter());
                        MDC.put("destination", clientIdentity.getDestination());
                        embededServer.unsubscribe(clientIdentity);
                        stopCanalInstanceIfNecessary(clientIdentity);// 尝试关闭
                        NettyUtils.ack(ctx.getChannel(), null);
                    } else {
                        NettyUtils.error(401, MessageFormatter.format("destination or clientId is null",
                                                                      unsub.toString()).getMessage(), ctx.getChannel(),
                                         null);
                    }
                    break;
                case GET:
                    Get get = CanalPacket.Get.parseFrom(packet.getBody());
View Full Code Here

TOP

Related Classes of com.alibaba.otter.canal.protocol.CanalPacket.Unsub

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.