2016-02-23 29 views
0

我想獲得http4從報頭中的值,但它扔我駱駝 - 如何在設置http4端點時從頭部獲取值?

Failed to create route route15 at: >>> To[${header.ExternalEndPoint}] 

這裏是我的代碼

.toF("http4://%s", simple("${header.ExternalEndPoint}")) 

.toF("http4://%s", constant("${header.ExternalEndPoint}")) 

它只工作時我硬編碼值如

.toF("http4://localhost/foo"); 
在駱駝2.16之前不支持
+0

看到這個常見問題:HTTP://駱駝.apache.org /如何使用的,一個動態-URI功能於to.html –

回答

0

Dynamic URIs in "to"。如果您使用比2.16以下的版本,那麼你應該使用recipientList

.recipientList(simple("http4://${header.ExternalEndPoint}"))

從2.16起,toD是你的朋友:

.toD("http4://${header.ExternalEndPoint}")