@Test public void testPublishContentIsNull() { try { this.iProducer.publish(new WeEvent(this.topicName, null), this.channelName); Assert.fail(); } catch (BrokerException e) { Assert.assertEquals(ErrorCode.EVENT_CONTENT_IS_BLANK.getCode(), e.getCode()); } }
@Override public CompletableFuture<SendResult> publish(WeEvent event, String channelName) throws BrokerException { log.debug("publish input param WeEvent: {}", event); ParamCheckUtils.validateEvent(event); this.validateChannelName(channelName); return fabricDelegate.publishEvent(event.getTopic(), channelName, new String(event.getContent(), StandardCharsets.UTF_8), JsonHelper.object2Json(event.getExtensions())); }
FabricBroker4Producer extends FabricTopicAdmin implements IProducer { @Override public CompletableFuture<SendResult> publish(WeEvent event, String channelName) throws BrokerException { log.debug("publish input param WeEvent: {}", event); ParamCheckUtils.validateEvent(event); this.validateChannelName(channelName); return fabricDelegate.publishEvent(event.getTopic(), channelName, new String(event.getContent(), StandardCharsets.UTF_8), JsonHelper.object2Json(event.getExtensions())); } }
FabricBroker4Producer extends FabricTopicAdmin implements IProducer { @Override public CompletableFuture<SendResult> publish(WeEvent event, String channelName) throws BrokerException { log.debug("publish input param WeEvent: {}", event); ParamCheckUtils.validateEvent(event); this.validateChannelName(channelName); return fabricDelegate.publishEvent(event.getTopic(), channelName, new String(event.getContent(), StandardCharsets.UTF_8), JsonHelper.object2Json(event.getExtensions())); } FabricBroker4Producer(FabricDelegate fabricDelegate); }
FabricBroker4Producer extends FabricTopicAdmin implements IProducer { @Override public CompletableFuture<SendResult> publish(WeEvent event, String channelName) throws BrokerException { log.debug("publish input param WeEvent: {}", event); ParamCheckUtils.validateEvent(event); this.validateChannelName(channelName); return fabricDelegate.publishEvent(event.getTopic(), channelName, new String(event.getContent(), StandardCharsets.UTF_8), JsonHelper.object2Json(event.getExtensions())); } FabricBroker4Producer(FabricDelegate fabricDelegate); @Override boolean startProducer(); @Override boolean shutdownProducer(); @Override CompletableFuture<SendResult> publish(WeEvent event, String channelName); }
FabricBroker4Producer extends FabricTopicAdmin implements IProducer { @Override public CompletableFuture<SendResult> publish(WeEvent event, String channelName) throws BrokerException { log.debug("publish input param WeEvent: {}", event); ParamCheckUtils.validateEvent(event); this.validateChannelName(channelName); return fabricDelegate.publishEvent(event.getTopic(), channelName, new String(event.getContent(), StandardCharsets.UTF_8), JsonHelper.object2Json(event.getExtensions())); } FabricBroker4Producer(FabricDelegate fabricDelegate); @Override boolean startProducer(); @Override boolean shutdownProducer(); @Override CompletableFuture<SendResult> publish(WeEvent event, String channelName);  }