在 Camel sql 组件中使用标题值作为表名 [英] Using header value as table name in Camel sql component

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

问题描述

我想使用标头值在 sql 组件中设置 db 表的名称.是否有捷径可寻?.to("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}")).

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

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