骆驼新泽西整合 [英] Camel-Jersey Integration

查看:187
本文介绍了骆驼新泽西整合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用泽西2作为REST接口的要求。我需要这个适应它使用了CXF在SOAP请求通过现有的系统。我知道我应该用CXF-RS,但...这不是客户想要什么。

I have a requirement to use Jersey 2 as the Rest interface. I need to adapt this to an existing system which has used CXF to pass in SOAP requests. I know I should use CXF-RS but... it's not what the client wants.

我是自动生成从XML模型WADL,并使用自动生成的资源类(使用CXF,但幕后这么说),所以我真的不希望从内部调用模板生产资源类。

I am auto-generating a WADL from a XML model and using that to autogenerate the resource classes (using CXF, but behind the scenes so to speak), so I really don't want to call a producer template from within the resource class.

所以,我以为我可以在包装方面REST资源类能够捕捉必要的信息。看着它进一步我知道有后处理滤波器,会给我足够的信息来火了骆驼制作模板与相关资源的方法采取了相应的信息。这就是我对标题进行规划。

So, I have thought that I could wrap the REST resource class in aspects that would capture the necessary information. Looking at it further I realise there are post-processing filters which would give me enough information to fire off a Camel producer template with the appropriate information taken from the resource method in question. That's where I am planning on heading.

可是我真的想做一些更stasifying和可维护性和可重用通过创建一个真正的骆驼端点做我想做的。一个消费者现在。我知道这是可能的。但我的问题是 - 我在哪里开始呢?我如何映射JAX-RS资源类,比如交换对象和参数头。看起来好像它应该是简单,但我真的不明白的过程,其中一个也可以,因为它是劫持资源的方法为在骆驼组成部分消费者的方法。主要是我想利用从XML到对象自动转换JAXB,它允许的优势。

And yet: I really want to do something a bit more stasifying and maintainable and reusable by creating a real Camel endpoint to do what I want. A consumer for now. I know this is possible. But my question is - where do I start? How do I map the Jax-RS resource classes to, say an exchange object and the parameters to headers. It seems as if it should be simple but I don't really understand the process by which one can as it were hijack the resource methods into the consumer method in a Camel component. Primarily I want to take advantage of the automatic JAXB conversion from xml to objects that it allows for.

推荐答案

有一个在这个<一个href=\"https://github.com/hoomanb1/fuse-examples/blob/master/camel-sql-xa-rest/fuse-spring-rest-messaging/src/main/resources/META-INF/spring/spring-context.xml\"相对=nofollow>例如并看看是否有帮助,基本上它暴露了一个REST端点并注入制作成模板调用一个ActiveMQ的端点的bean。

Have a look at this example and see if that helps, basically it exposes a REST endpoint and injects producer template into a bean that calls an activemq endpoint.

这篇关于骆驼新泽西整合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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