休息端点
<jaxrs:server id="jaxrs"
address="http://127.0.0.1:8080/jaxrs">
<jaxrs:serviceBeans>
<ref component-id="service1" />
...
...
<ref component-id="serviceX" />
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref component-id="runtimeExceptionMapper" />
</jaxrs:providers>
</jaxrs:server>
Run Code Online (Sandbox Code Playgroud)
路线
<route id="secureBridgeRoute">
<from uri="jetty:https://0.0.0.0:443/jaxrs?sslContextParametersRef=sslContextParameters&matchOnUriPrefix=true&minThreads=8&maxThreads=16" />
<transacted ref="JTA_TRANSACTION" />
<to uri="jetty:http://127.0.0.1:8080/jaxrs?bridgeEndpoint=true&throwExceptionOnFailure=true" />
</route>
Run Code Online (Sandbox Code Playgroud)
DAO
<bean id="dao1" class="com.example.Dao1" activation="eager">
<jpa:context unitname="PU" property="entityManager" type="TRANSACTION" />
</bean>
Run Code Online (Sandbox Code Playgroud)
服务bean
<bean id="service1" class="com.example.Service1" activation="eager">
<property name="dao1" ref="dao1" />
<property name="dao2" ref="dao2" />
<tx:transaction method="*" value="Required" />
</bean>
Run Code Online (Sandbox Code Playgroud)
服务bean方法伪代码
boolean create(entity1, entity2) {
dao1.persist(entity1);
dao2.persist(entity2);
}
Run Code Online (Sandbox Code Playgroud)
当dao2持久失败时,事务没有回滚.Entity1被插入到DB中.
附加信息
1)TransactionManager定义
<reference id="platformTransactionManager" interface="org.springframework.transaction.PlatformTransactionManager" />
<bean id="JTA_TRANSACTION" class="org.apache.camel.spring.spi.SpringTransactionPolicy"> …Run Code Online (Sandbox Code Playgroud) JBoss Fuse和Apache驼峰有什么区别?如何在构建基于微服务的应用程序中使用它?
我熟悉Camel-SMPP,它对我的消费者和生产者路线也很有用.我正在使用Selenium SMPP SIM来测试它.
来自uri ="smpp://smppclient@127.0.0.1:8056?password = password&systemType = consumer"/>
to uri ="smpp:// smppclient @ localhost:2775?password = password && systemType = producer"/>
但是,我想让我的Camel作为服务器运行(它接受来自众多客户的SMS).我当前的From路由与一个SMS发送器紧密耦合.如何将其修改为通用服务器.骆驼有可能吗?
我是ESB的新手,并试图了解ESB概念和实际用例.
我挖掘了一些开源ESB产品,看起来Apache Camel是最着名的一个[来自Apache家族].
我发现,大多数人使用在Apache Camel上开发的Jboss Fuse,或者只是在Camel上添加了更多功能.
虽然,我正在尝试和搜索互联网将近半天,并且无法找到我们何时使用ESB和现实世界的示例场景和基本教程来启动和理解Fuse ESB.
任何人都可以指出我如何克服这个问题并在路线图上找到正确的方向,我也需要将它们与Liferay门户集成.
我是 apache Camel 的新手,并通过 Java DSL 使一些路由正常工作。
现在我想知道是否有机会使用 JBoss Fuse 自动获得这些路线的可视化表示?
我的意思是不再手工绘制它,更多的是自动记录:-)
编辑:
由于否决似乎比答案更容易,我尝试稍微改一下我的问题。
我正在寻找一种可能性,对我定义的路线(Java)进行逆向工程,并从中获取带有盒子的图片。
Hawtoi,我之前尝试过的,给出了一个漂亮的结果,但也提供了很多我的文档不需要的其他东西。
因此我看了一下 JBoss Fuse。但在这里我只能绘制我的流程并将它们保存为blueprint.xml。JBoss Fuse 中无法从 Java 代码到 blueprint.xml 吗?我错过了什么吗?
我有一个apache camel路线,正在交换机体上处理POJO.
请查看标记为1到3的行序列.
from("direct:foo")
.to("direct:doSomething") // 1 (POJO on the exchange body)
.to("direct:storeInHazelcast") // 2 (destroys my pojo! it gets -1)
.to("direct:doSomethingElse") // 3 (Where is my POJO??)
;
Run Code Online (Sandbox Code Playgroud)
现在我需要put在hazelcast组件上使用操作,遗憾的是需要将body设置为值-1.
from("direct:storeInHazelcast")
.setBody(constant(-1))
.setHeader(HazelcastConstants.OPERATION, constant(HazelcastConstants.PUT_OPERATION))
.setHeader(HazelcastConstants.OBJECT_ID, constant(LAST_FLIGHT_UPDATE_SEQ))
.to("hazelcast:map:MyNumber")
;
Run Code Online (Sandbox Code Playgroud)
对于标记为2的行,我想将该交换的COPY发送给该storeInHazelcast路径.
首先,我试过.multicast(),但交换机构仍然搞砸了(-1).
// shouldnt this copy the exchange?
.multicast().to("direct:storeInHazelcast").end()
Run Code Online (Sandbox Code Playgroud)
然后我尝试了.wireTap(),它可以作为"火灾和忘记"(异步)模式,但实际上我需要它来阻止,并等待它完成.你能制作wireTap块吗?
// this works but I need it to be sync processing (not async)
.wireTap("direct:storeInHazelcast").end()
Run Code Online (Sandbox Code Playgroud)
所以我在这里寻找一些提示.据我所知,multicast()应该复制交换,但setBody()在我的storeInHazelcast路线中查看搞砸了原来的交换.
或者也许还有其他方法可以做到这一点. …
我正在使用jboss fuse 6.1-final:
这是我简单的路线:
<route>
<from uri="cxf:bean:synchronousEndpoint"/>
<log message="Service invoked." />
<process ref="simpleProcessor"/>
</route>
Run Code Online (Sandbox Code Playgroud)
并且在simpleProcessor我将正确的响应(即相应的JAXB对象)放入上下文中.但是,它以错误回应:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Marshalling Error: java.lang.Object cannot be cast to org.w3c.dom.Element</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)
这是堆栈跟踪:
Caused by: java.lang.ClassCastException: java.lang.Object cannot be cast to org.w3c.dom.Element
Run Code Online (Sandbox Code Playgroud)
有任何提示或建议吗?
SAP PI / PO现在是否被视为真正的ESB?我阅读过各种资料,声称4-5年前还不存在。
如果您有一个非常以SAP为中心的环境,强烈建议使用PI / PO代替Mule ESB,Jboss Fuse,BizTalk和Oracle ESB等更标准的集成平台吗?
如果您主要具有提到的与平台无关的ESB的专业知识,那么仍然值得与SAP Pi集成吗?PI的优点是什么?
我看到它们都有一些与SAP集成的选项,但是在SAP场景中似乎很难获得无偏见的信息。
我想在骆驼蓝图中调用 POST 休息服务。我的蓝图xml文件如下:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
<bean class="org.apache.cxf.jaxrs.provider.json.JSONProvider" id="jsonProvider"/>
<cxf:rsClient address="http://jsonplaceholder.typicode.com/posts"
id="rsClient" loggingFeatureEnabled="true">
<cxf:providers>
<ref bean="jsonProvider" component-id="jsonProvider"/>
</cxf:providers>
</cxf:rsClient>
<camelContext id="RESTCamelContext" xmlns="http://camel.apache.org/schema/blueprint">
<route id="RESTRoute">
<from id="_from1" uri="timer:foor?repeatCount=1"/>
<to id="_to1" uri="log:body?level=INFO"/>
<setHeader headerName="Content-Type" id="_setHeader1">
<constant>application/json</constant>
</setHeader>
<setHeader headerName="Exchange.HTTP_METHOD" id="_setHeader2">
<constant>POST</constant>
</setHeader>
<to id="_to2" uri="cxfrs:bean:rsClient"/>
<to id="_to3" uri="log:body?level=INFO"/>
</route>
</camelContext>
Run Code Online (Sandbox Code Playgroud)
但我不知道如何在正文请求中传递 JSON 对象。
我有一个骆驼应用程序,它从一个大小为 13000 的 jms 队列接收一个 json 数组请求,json 数组请求的结构如下。我想以 5 个为一组流式传输和拆分 json 数组。例如,如果我收到一个大小为 100 的 json 数组,我想将其分组为 5 个并将其拆分为 20 个请求。是否有内置的骆驼功能来分组和拆分 json 数组,还是我需要编写自定义拆分器?
我正在使用骆驼 2.17 版本。
示例 json 数组:
[{
"name": "Ram",
"email": "ram@gmail.com",
"age": 23
}, {
"name": "Shyam",
"email": "shyam23@gmail.com",
"age": 28
}, {
"name": "John",
"email": "john@gmail.com",
"age": 33
}, {
"name": "Bob",
"email": "bob32@gmail.com",
"age": 41
}, {
"name": "test1",
"email": "test1@gmail.com",
"age": 41
}, {
"name": "test2",
"email": "test2@gmail.com",
"age": 41
}, {
"name": "test3",
"email": …Run Code Online (Sandbox Code Playgroud)