Creating, populating and using JMS headers

JMS headers must be created and populated before being added to the service component architecture message.

Why and when to perform this task

The user can create, populate and deploy a JMS header by performing the following steps:

Steps for this task

  1. At the system programming interface create and populate the JMS header using the following code:
    JMSHeader header = JMSFactory.eINSTANCE.createJMSHeader();
    			
    header.setJMSCorrelationID(…);
    		
    header.setJMSDeliveryMode(PersistenceType.PERSISTENT_LITERAL);
    			
    header.setJMSDestination(“Destination String”);
    header.setJMSExpiration(“xxx”);
    header.setJMSType(“testtype”);
    				
    Enumeration propertyNames = xxx.getPropertyNames();
    		while(propertyNames.hasMoreElements()){
    			String propertyName = (String)propertyNames.nextElement();
    			Object propertyValue = msg.getObjectProperty(propertyName);
    			NVTTriplet property = JMSFactory.eINSTANCE.createNVTTriplet();
    			property.setName(propertyName);
    			property.setValue(propertyValue);
    			header.getProperty().add(property);
    		}
  2. Add the JMS header to the SCA Message using the following code:
    message.getHeaders().put(JMSHeader.HEADER_NAME, jmsHeader);

Terms of use | | Broken links

Last updated: Tue Feb 21 17:19:15 2006

(c) Copyright IBM Corporation 2005.
This information center is powered by Eclipse technology (http://www.eclipse.org)