@Test public void testSubscribe() throws Exception { String subscribeId = this.weEventClient.subscribe(this.topicName, WeEvent.OFFSET_LAST, extensions, new IWeEventClient.EventListener() { @Override public void onEvent(WeEvent event) { log.info("onEvent: {}", event.toString()); Assert.assertFalse(event.getTopic().isEmpty()); Assert.assertFalse(event.getEventId().isEmpty()); } @Override public void onException(Throwable e) { log.error("onException:", e); Assert.fail(); } }); Assert.assertFalse(subscribeId.isEmpty()); Thread.sleep(this.FIVE_SECOND); }
@Override public String subscribe(String topic, String offset, Map<String, String> extension, @NonNull EventListener listener) throws BrokerException { return dealSubscribe(topic, offset, extension, listener); }
WeEventClient implements IWeEventClient { @Override public String subscribe(String topic, String offset, Map<String, String> extension, @NonNull EventListener listener) throws BrokerException { return dealSubscribe(topic, offset, extension, listener); } }
WeEventClient implements IWeEventClient { @Override public String subscribe(String topic, String offset, Map<String, String> extension, @NonNull EventListener listener) throws BrokerException { return dealSubscribe(topic, offset, extension, listener); } WeEventClient(String brokerUrl, String groupId, String userName, String password, int timeout); }
WeEventClient implements IWeEventClient { @Override public String subscribe(String topic, String offset, Map<String, String> extension, @NonNull EventListener listener) throws BrokerException { return dealSubscribe(topic, offset, extension, listener); } WeEventClient(String brokerUrl, String groupId, String userName, String password, int timeout); @Override boolean unSubscribe(String subscriptionId); @Override boolean open(String topic); @Override boolean close(String topic); @Override boolean exist(String topic); @Override TopicPage list(Integer pageIndex, Integer pageSize); @Override TopicInfo state(String topic); @Override WeEvent getEvent(String eventId); @Override SendResult publish(WeEvent weEvent); @Override CompletableFuture<SendResult> publishAsync(WeEvent weEvent); @Override String subscribe(String topic, String offset, Map<String, String> extension, @NonNull EventListener listener); @Override String subscribe(String[] topics, String offset, Map<String, String> extension, @NonNull EventListener listener); static SSLContext getSSLContext(); }
WeEventClient implements IWeEventClient { @Override public String subscribe(String topic, String offset, Map<String, String> extension, @NonNull EventListener listener) throws BrokerException { return dealSubscribe(topic, offset, extension, listener); } WeEventClient(String brokerUrl, String groupId, String userName, String password, int timeout); @Override boolean unSubscribe(String subscriptionId); @Override boolean open(String topic); @Override boolean close(String topic); @Override boolean exist(String topic); @Override TopicPage list(Integer pageIndex, Integer pageSize); @Override TopicInfo state(String topic); @Override WeEvent getEvent(String eventId); @Override SendResult publish(WeEvent weEvent); @Override CompletableFuture<SendResult> publishAsync(WeEvent weEvent); @Override String subscribe(String topic, String offset, Map<String, String> extension, @NonNull EventListener listener); @Override String subscribe(String[] topics, String offset, Map<String, String> extension, @NonNull EventListener listener); static SSLContext getSSLContext();  }