use of org.apache.rocketmq.common.protocol.body.ProducerConnection in project rocketmq-externals by apache.
the class ProducerServiceImplTest method getProducerConnection.
@Test
public void getProducerConnection() throws Exception {
ProducerConnection producerConnection = new RetryTempLate<ProducerConnection>() {
@Override
protected ProducerConnection process() throws Exception {
return producerService.getProducerConnection(TEST_PRODUCER_GROUP, TEST_CONSOLE_TOPIC);
}
}.execute(10, 1000);
Assert.assertNotNull(producerConnection);
Assert.assertTrue(Lists.transform(Lists.newArrayList(producerConnection.getConnectionSet()), new Function<Connection, String>() {
@Override
public String apply(Connection input) {
return input.getClientAddr().split(":")[0];
}
}).contains(TestConstant.LOCAL_HOST));
}
use of org.apache.rocketmq.common.protocol.body.ProducerConnection in project rocketmq-externals by apache.
the class ProducerController method producerConnection.
@RequestMapping(value = "/producerConnection.query", method = { RequestMethod.GET })
@ResponseBody
public Object producerConnection(@RequestParam String producerGroup, @RequestParam String topic) {
ProducerConnection producerConnection = producerService.getProducerConnection(producerGroup, topic);
producerConnection.setConnectionSet(ConnectionInfo.buildConnectionInfoHashSet(producerConnection.getConnectionSet()));
return producerConnection;
}
Aggregations