I have seen a number of examples where an ActiveMQ TCP transport in Camel is exposed using XML but none using Java.
Anyone know how to do this?
I can't seem to find an example anywhere.
I am using Spring Boot with Camel, ActiveMQ.
I believe that I have found the answer.
If creating a new BrokerService...
//whatever URI, broker name you want
String uri = "tcp://localhost:61617";
String brokerName = "my-tcp-broker";
BrokerService brokerService = new BrokerService();
brokerService.setBrokerName(brokerName);
TransportConnector connector = new TransportConnector();
connector.setUri(new URI(uri));
brokerService.addConnector(connector);
brokerService.start();
Or, if you are using an existing BrokerService...
BrokerService brokerService = BrokerRegistry.getInstance().lookup(brokerServiceName);
TransportConnector connector = new TransportConnector();
connector.setUri(new URI(uri));
connector.setBrokerService(brokerService);
brokerService.addConnector(connector);
connector.start();