I want to listen on ActiveMQ topic based on the hostname of system and some other logic, So i planned to use pollEnrich for it so i evaluate my logic and provide topic name in pollEnrich but as per document
*pollEnrich or enrich does not access any data from the current Exchange which means when polling it cannot use any of the existing headers you may have set on the Exchange. For example you cannot set a filename in the Exchange.FILE_NAME header and use pollEnrich to consume only that file. For that you must set the filename in the endpoint URI.* How i can figure out this from("timer://ipc?repeatCount=1") .. some logic.. .setHeader("topic_no",simple("{{env:HOSTNAME}}")) .pollEnrich("mqtt:foo?host=tcp://0.0.0.0:1883 &subscribeTopicNames=${header.topic_no}/status&clientId=ipc") .to("log:my?showAll=true&multiline=true"); Please dont suggest to use hostname directly in URI, As i highlighted i have to compute other logic too, What other option or way i can use?