如何确定骆驼交换对象的类型 [英] How to determine the type of the camel exchange object

查看:233
本文介绍了如何确定骆驼交换对象的类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web服务器上运行的两个不同的服务。无论是服务已操作命名为'某某',用下面的参数。

I have two different services running on a web server. Both the services have an operation named 'xyz', with the following arguments.

客服1:

公共字符串XYX(Student对象){}

客服2:

公共字符串XYZ(Employee对象){}

现在我有一个客户端,它会调用基于其接收到的消息,这些服务之一的操作。该消息将被接收般地交流。所以,我需要确定消息的类型,然后调用相应的服务。

Now i have a client which will invoke the operation of one of these services based on the message that it receives. The message will be received as a camel exchange. So i need to identify the type of the message and then invoke the appropriate service.

我如何识别原始类型被收为骆驼交换的消息。

How do i identify the original type of the message that is received as a camel exchange.

感谢。

推荐答案

尝试exchange.getIn()。getBody()的instanceof学生

Try exchange.getIn().getBody() instanceof Student

这篇关于如何确定骆驼交换对象的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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