使用标头值作为骆驼SQL组件表名 [英] Using header value as table name in Camel sql component

查看:109
本文介绍了使用标头值作为骆驼SQL组件表名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用标头值在SQL组件设置db表的名称。有没有一种简单的方法来做到这一点?
。要(SQL:DROP TABLE $ {in.header.tablename})
抛出无效字符异常

I would like to use the header value for setting the name of db table in sql component. Is there an easy way to do this? .to("sql:drop table ${in.header.tablename}") throws invalid character exception

推荐答案

如果您希望将消息路由动态,你可以使用的收件人列表。这条路线可能是

If you want to route the message dynamically, you can use recipient-list. The route could be

from("direct:a").recipientList(simple("sql:drop table ${in.header.tablename}")).

这篇关于使用标头值作为骆驼SQL组件表名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆