2017-09-22 131 views
0

我正在嘗試使用camel-activemq依賴關係並設置一個正在偵聽activemq隊列的服務。當我嘗試專門設置的駝路的連接,我使用的端點是:camel-activemq brokerURL參數在駝峯路由中無法識別

「的ActiveMQ:MAILQ用戶名=管理員&密碼=密碼& trustAllPackages =真& concurrentConsumers = 10 & exchangePattern = INONLY & maxConcurrentConsumers? = 20 & brokerURL = tcp:// mail-broker-queue-pod:61616「

我的問題是activemq依賴關係是故障轉移到」localhost:61616「,因爲它不會識別brokerURL參數。

我想連接到在openshift服務器上部署的隊列。有沒有其他人看到這個問題?

由於

回答

1

brokerURL不是ActiveMQ的部件的參數。如果你想指定brokerURL,那麼你必須在activemq組件添加到類似下面的CamelContext(source):

如果你使用Spring( source
camelContext.addComponent("activemq", activeMQComponent("vm://localhost?broker.persistent=false")); 

例子:

@Bean(name = "activemq") 
public ActiveMQComponent createActiveMQComponent() { 
    return ActiveMQComponent.activeMQComponent("tcp://localhost:61616"); // configure brokerURL here 
} 
+0

是我我可以通過設置連接工廠來通過java代碼添加activemq組件。但是,我只想通過使用端點來配置和監聽遠程隊列。任何想法通過使用端點連接到activemq隊列correcto參數?謝謝 – Lukeriggz

+1

如上所述,這是不可能的。但是,如果您在Spring Boot中使用Camel,則可以在spring引導application.properties/yaml文件中配置代理url。 –