私はMuleを初めて使っています。私は本当にAnypoint Studioが大好きです。私はActiveMQにメッセージを書き込もうとしました。私は文字列ペイロードの後にJMSを直接置くと動作し、ActiveMQでメッセージを取得できることが分かりました。以下のように:ObjectToJMSMessageの正しいエンドポイントは何ですか?
しかし、私はそれでてJMSMessageトランスにオブジェクトを置く場合:
をそれがエラーを与え続け:java.lang.IllegalStateException: This transformer needs a valid endpoint
。私はほとんどすべての種類のエンドポイントを試しましたが、役に立たなかった。私は、変圧器の正しい終点がどうなるべきか疑問に思っていますか?
コードは非常に簡単です:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:db="http://www.mulesoft.org/schema/mule/db" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
<jms:activemq-connector name="Active_MQ" brokerURL="tcp://localhost:61616" validateConnections="true" doc:name="Active MQ" specification="1.1" password="admin" username="admin"/>
<flow name="basic_tutorialFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-payload value="hello world" doc:name="Set Payload"/>
<jms:object-to-jmsmessage-transformer doc:name="Object to JMSMessage"/>
<jms:outbound-endpoint connector-ref="Active_MQ" doc:name="JMS" topic="mytopic"/>
<object-to-string-transformer doc:name="Object to String"/>
</flow>
</mule>
ありがとうございます!私はいつこの "Object to JMSMessage"トランスを使用すべきかを知りたいですか?そして私がそれを使うと、どのコンポーネントがエンドポイントになるのでしょうか? –