@Override protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception { final String value = String.class.cast(parameters.remove("value")); return new DefaultEndpoint() { @Override protected String createEndpointUri() { return uri; } @Override public Producer createProducer() throws Exception { return new DefaultProducer(this) { @Override public void process(final Exchange exchange) throws Exception { exchange.getIn().setBody(exchange.getIn().getBody(String.class) + value); } }; } @Override public Consumer createConsumer(final Processor processor) throws Exception { throw new UnsupportedOperationException(); } @Override public boolean isSingleton() { return true; } }; }
public HazelcastInstanceConsumer(HazelcastInstance hazelcastInstance, DefaultEndpoint endpoint, Processor processor) { super(endpoint, processor); hazelcastInstance.getCluster().addMembershipListener(new HazelcastMembershipListener()); }