Difference between revisions of "Common Messaging endpoints"

From Gcube Wiki
Jump to: navigation, search
Line 1: Line 1:
The Messagin Endpoints Lirbary is a simple library that has been developed in order to harvest and make available the Message broker instances addresses that are published on the gCube Information System
+
Trhe Messagin Endpoints Libary is a simple library that has been developed in order to harvest and make available to clients the Message broker instances addresses that are published on the gCube Information System
  
 
The library expects each Message Broker instance to be published on the IS as a gCube Runtime Resource having the following model:
 
The library expects each Message Broker instance to be published on the IS as a gCube Runtime Resource having the following model:
Line 72: Line 72:
 
</pre>
 
</pre>
  
The current implementation is using ONLY the openwire broker interface, but in future  release if requested we can also addd other inteface addresses (.e.g STOMP) and give the possobility to retrieve them trough the library.
+
The current implementation is using ONLY the openwire broker interface, but in future  release if requested we can also add other interface addresses (.e.g STOMP) and give the possibility to retrieve them trough the library.
  
  
Line 80: Line 80:
 
<source lang="java5">
 
<source lang="java5">
  
ScopeProvider.instance.set(<scope>);
+
ScopeProvider.instance.set(<scope>);
  
ScheduledRetriever retriever = BrokerEndpoints.getRetriever(<waiting_time>, <refresh_period>);
+
ScheduledRetriever retriever = BrokerEndpoints.getRetriever(<waiting_time>, <refresh_period>);
  
 
</source>
 
</source>
Line 95: Line 95:
 
<source lang="java5" >
 
<source lang="java5" >
  
ScopeProvider.instance.set(<scope>);
+
ScopeProvider.instance.set(<scope>);
  
ScheduledRetriever retriever = BrokerEndpoints.getRetriever();
+
ScheduledRetriever retriever = BrokerEndpoints.getRetriever();
  
 
</source>
 
</source>

Revision as of 14:12, 18 April 2013

Trhe Messagin Endpoints Libary is a simple library that has been developed in order to harvest and make available to clients the Message broker instances addresses that are published on the gCube Information System

The library expects each Message Broker instance to be published on the IS as a gCube Runtime Resource having the following model:


 <ID></ID>
    
   <Type>RuntimeResource</Type>
    
   <Scopes>
        
      <Scope>/xxx/xxxxx</Scope>
    
   </Scopes>
    
   <Profile>
        
      <Category>Service</Category>
        
      <Name>MessageBroker</Name>
        
      <Description />
        
      <Platform>
            
         <Name>ActiveMQ</Name>
            
         <Version>5</Version>
            
         <MinorVersion>5</MinorVersion>
            
         <RevisionVersion>1</RevisionVersion>
            
         <BuildVersion>1</BuildVersion>
        
      </Platform>
        
      <RunTime>
            
         <HostedOn>hostname</HostedOn>
            
         <GHN UniqueID="" />
            
         <Status>READY</Status>
        
      </RunTime>
        
      <AccessPoint>
            
         <Description>openwire interface</Description>
            
         <Interface>
                
            <Endpoint EntryName="openwire">tcp://hostname:port</Endpoint>
            
         </Interface>
            
         <AccessData>
                
            <Username />
                
            <Password />
            
         </AccessData>
        
      </AccessPoint>
    
   </Profile>


The current implementation is using ONLY the openwire broker interface, but in future release if requested we can also add other interface addresses (.e.g STOMP) and give the possibility to retrieve them trough the library.


The Library can be instantiated by clients to retrieve MessageBroker addresses as follows:


 ScopeProvider.instance.set(<scope>);
 
 ScheduledRetriever retriever = BrokerEndpoints.getRetriever(<waiting_time>, <refresh_period>);
  • waiting_time specifies the waiting time in seconds ( the MAX waiting time for the library to try to contact the IS and get the profiles)
  • refresh_period specifies the refreshing time for the profiles

each ScheduledRetriever is static within the JVM, so only one ScheduledRetriever is instantiated per scope.

Once the retriever is instantiated it can be also retrieved as follows

 ScopeProvider.instance.set(<scope>);
 
 ScheduledRetriever retriever = BrokerEndpoints.getRetriever();


The addresses provided are of two types:

  • JMS failover endpoint ( retriever.getFailoverEndpoint())
  • Broker addresses (retriever.getEndpoints())