2013-12-18 2 views
1

SOAP 웹 서비스 클라이언트 인 Mule Flow가 있습니다 (Mule Flow - A). 이 클라이언트 호출은 30 분마다 실행되어 타사에서 고유 한 세션 키를 검색합니다. 나는 자신의 흐름에서이 세션 변수를 참조해야하는 다른 뮬 흐름 (별도의 뮬 응용 프로그램으로 실행)이 있습니다. 내 질문은 - 노새 흐름 A에 의해 검색된 세션 키를 뮬 서버 메모리에 유지하여 다른 뮬 응용 프로그램이 런타임 중에 액세스 할 수 있도록하는 방법이 있습니까? 파일이나 데이터베이스의 어딘가에 데이터를 저장하고 검색 할 수는 있지만 해결책으로 결론을 내리기 전에이 작업을 수행 할 수 있는지 확인하고 싶습니다.Mule 변수 데이터를 Mule 서버 메모리에 저장할 수 있습니까

감사합니다. 공유 객체 저장소에 대한

업데이트 샘플 뮬 흐름 :

흐름 1 :

<?xml version="1.0" encoding="UTF-8"?> 

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore" 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" version="EE-3.4.0" 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/objectstore http://www.mulesoft.org/schema/mule/objectstore/1.0/mule-objectstore.xsd"> 

    <spring:beans> 
     <spring:bean id="myListableObjectStore" class="org.mule.util.store.SimpleMemoryObjectStore"/> 
    </spring:beans> 
    <objectstore:config name="ObjectStore" objectStore-ref="myListableObjectStore" doc:name="ObjectStore"/> 
    <flow name="objectstoreFlow1" doc:name="objectstoreFlow1"> 
     <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8083" doc:name="HTTP"/> 
     <message-filter doc:name="Filter favicon"> 
     <not-filter> 
      <wildcard-filter pattern="/favicon.ico" caseSensitive="true"/> 
     </not-filter> 
     </message-filter> 
     <logger message="#[message.InboundProperties.key]" level="INFO" doc:name="Logger"/> 
     <objectstore:store config-ref="ObjectStore" key="#[message.inboundProperties.key]" value-ref="#[message.inboundProperties.value]" doc:name="ObjectStore"/> 

    </flow> 
</mule> 

뮬 흐름 2 - 나는 수있을 것인가 값

<?xml version="1.0" encoding="UTF-8"?> 

<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore" 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" version="EE-3.4.0" 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/objectstore http://www.mulesoft.org/schema/mule/objectstore/1.0/mule-objectstore.xsd"> 

    <spring:beans> 
     <spring:bean id="myListableObjectStore" class="org.mule.util.store.SimpleMemoryObjectStore"/> 
    </spring:beans> 
    <objectstore:config name="ObjectStore" objectStore-ref="myListableObjectStore" doc:name="ObjectStore"/> 
    <flow name="MemoryTest2Flow1" doc:name="MemoryTest2Flow1"> 
     <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8084" doc:name="HTTP"/> 
       <message-filter doc:name="Filter favicon"> 
     <not-filter> 
      <wildcard-filter pattern="/favicon.ico" caseSensitive="true"/> 
     </not-filter> 
     </message-filter> 
     <objectstore:retrieve config-ref="ObjectStore" key="#[message.inboundProperties.key]" doc:name="ObjectStore"/> 
    <logger level="ERROR" doc:name="Logger"/> 
    </flow> 
</mule> 

를 검색하려면 검색 할 같은 열쇠를 사용하여 두 번째 뮬 흐름의 일부로 첫 번째 흐름에 저장된 객체?

답변

2

예, Mule을 사용하여이 모든 작업을 수행 할 수 있습니다.

아마도 http SOAP 또는 REST를 통해 Quartz scheduler endpoint을 사용하여 타사에 전화 할 것입니다.

노새 JDBC endpoint을 사용하여 거의 모든 데이터베이스에 새로 획득 한 키를 넣거나 mule-module-objectstore을 사용하여 메모리에 키를 보관하거나 파일 지속성을 유지할 수 있습니다.

그러면 종속 서비스에 대한 검색 방법을 고안하여 (JDBC 또는 objectstore를 사용하여) 선택한 위치에서 키를 가져올 수 있습니다. 세션 당 하나가 아닌 하나의 키만있는 것처럼 들리므로이 경우 세션 바를 사용해야하는 강력한 이유는 없습니다.

+0

답장을 보내 주셔서 감사합니다. 방금 뮬 모듈 객체 저장소에 대한 연구를했습니다. 이것은 나를 위해 도움이 될 수 있습니다. 두 개의 노새 응용 프로그램간에 객체 저장소를 공유 할 수 있는지 여부를 알고 있습니까? 내 샘플 Mule Applications이 내 질문에 추가 된 것을 찾으십시오. – jvas

+0

동일한 뮬 서버에서 실행되는 두 개의 앱인 경우 둘 다 동일한 객체 저장소에 액세스 할 수 있지만 실제로 시도하지는 않습니다. 이들이 별개의 뮬 서버라면 Mule EE를 사용하고 서버를 클러스터링해야합니다. 클러스터를 통해 오브젝트 저장소를 복제 할 cultured-objectstore를 사용하십시오. – mmeyer

+0

그들은 별도의 뮬 서버에 있지 않습니다. 두 앱 모두 동일한 뮬 서버에서 실행됩니다. 내 뮬 샘플을 샘플로 업데이트했습니다. 서버에 두 응용 프로그램을 모두 배포했지만 예외 (null) (org.mule.api.store.ObjectAlreadyExistsException)가 발생했습니다. 두 앱에서 전 세계적으로 객체 저장소를 지정하기 위해 누락 된 부분이 있습니까? – jvas