BOOMI : Publish Events to PubSub+ with custom headers & Listen to events and get headers

Hi Noel,

This kind of script (Groovy 2.4) on a “Data Process Shape”/“Custom Scripting”.
I’ll document it more explicitly later

import java.util.Properties;
import java.io.InputStream;
import groovy.json.JsonSlurper;

for( int i = 0; i < dataContext.getDataCount(); i++ ) 
{
    InputStream is    = dataContext.getStream(i);
    Properties  props = dataContext.getProperties(i);

    def jsonSlurper = new JsonSlurper();
    def object = jsonSlurper.parseText(props.getProperty("document.dynamic.userdefined.ddpUserPropertiesJSON"));

//  foo, baz, static_header_key - these are the three values being passed as JSON keys in the
//  Solace Connector userProperties JSON string.

//  foo, baz, static_header_key- these are the three DDPs created in the receiving
//  Boomi Process with  values set to the corresponding values from the user propertie JSON.  Note that
//  these DDPs are created here and do not need to be created ahead of time.
//  The developer needs to know the JSON keys coming in in this code.

    props.setProperty("document.dynamic.userdefined.foo",object.foo);
    props.setProperty("document.dynamic.userdefined.baz",object.baz);
    props.setProperty("document.dynamic.userdefined.static_header_key",object.static_header_key);

    dataContext.storeStream(is, props);
}