Apama with UM Integration

HI,

I am trying to connect Apama to UM (to read/write) through UM connectivity plugin. I am following the documentation http://techcommunity.softwareag.com/ecosystem/documentation/apama/v910/apama910/9-10_Connecting_Apama_Applications_to_External_Components.pdf.

I am getting the below error. Did i miss any configuration? could you please help me to resolve the issue.

ERROR [10164] - <manager.UMManager> Exception while creating chain manager: Error while opening: UMConnectivity.dll or a library it depends on for the plug-in: UMManager: The specified procedure could not be found. (127)
2017-03-17 00:40:11.320 ERROR [10164] - Failed to initialize correlator: Connectivity plug-ins startup failure

In the document(page No:259-Configuring adapters to use UM), we have to configure adapter to use UM. But i couldnt find which adapter is refered in the document?

Request your quick response.

Can you confirm you have the same version of UM installed in the same installation as Apama? - you need to install both Apama and UM into the same directory and run the correlator from that installation. What version of Apama and UM do you have installed?

Page 259 (Configuring adapters to use UM) is referring to IAF-based adapters - that is separate from the UM connectivity component.

Could you share what version of the product you’re using? If possible we’d definitely encourage you to use 9.12 with the latest fixes installed if possible, as several aspects of connectivity plugin usage will be a bit easier in 9.12 compared to 9.10.

And are you using the Software AG Designer UI or doing everything from linux/command line?

If you want to use JSON the the UM connectivity plug-in will be the easiest approach (a little extra coding would be required to parse JSON from Correlator-JMS).

Assuming you’re using Designer and 9.12, all you need to do is:

  • make sure you have both UM and Apama installed (i.e. tick them both when you run Software AG installer so they are present in the same installation, Apama needs at least the UM client libraries to be able to connect); sounds like this is probably the step you’re missing at the moment (you can check by looking for dlls in \UniversalMessaging\cplus\lib\x86_64)
  • from Designer use New > Connectivity and Adapters > Universal Messaging to add UM support to your project
  • UM configuration is really simple, just edit the UMConnectivity.properties file if you’re running UM on a non-default port or a remote machine, otherwise there is nothing to do at all :slight_smile:
  • for the JSON/mapping side you need to add the JSON codec to the connectivityPlugins of the UniversalMessaging.yaml file (as in “JSON codec” topic of the documentation).
  • then you just need to add a ClassifierCodec section to indicate what event type you want your messages to go to and optionally a MapperCodec if there are any UM headers you need to get into your EPL message (often there won’t be and the JSON will be all you need). What you need here is very dependent on what your actual messages/JSON docs look like, but there’s a complete end-to-end example of using the JSON, Classifier and Mapper codecs (using the HTTP client instead of UM but otherwise the same as what you’re doing) in \Apama\samples\connectivity_plugin\application\weather which you can copy from to get started. This also includes a .mon file with event definitions and a monitor.

Just to make things even easier, here’s a simple .yaml config you can copy into UniversalMessaging.yaml to do JSON and UM sending/receiving (with automatic creation of the relevant UM channel, and use of the DiagnosticCodec to log the JSON being sent back and forth):


connectivityPlugins:
  UMTransport:
        libraryName: UMConnectivity
        class: UMTransport
  UMStringCodec:
        libraryName: UMConnectivity
        class: UMStringCodec

  stringCodec:
        libraryName: connectivity-string-codec
        class: StringCodec

  classifierCodec:
        libraryName: ClassifierCodec
        class: ClassifierCodec

  mapperCodec:
        libraryName: MapperCodec
        class: MapperCodec

  diagnosticCodec:
        libraryName: DiagnosticCodec
        class: DiagnosticCodec

  jsonCodec:
        directory: ${APAMA_HOME}/lib/
        classpath:
           - json-codec.jar
        class: com.softwareag.connectivity.plugins.JSONCodec

dynamicChainManagers:
  UMManager:
    transport: UMTransport
    managerConfig:
      rnames: ${RNAME}
      channel:
        prefix: "um:"
        
        # default is error, but set to "create" for a simple demo
        missingChannelMode: create
        
        includePrefixOnUM: false
        escapeNamesOnUM: true

dynamicChains:
  UMJSONStringDynamicChainDefinition:
    - apama.eventMap:
        suppressLoopback: true
        description: "@{um.rnames}"
        remoteAddress: "@{um.rnames}"
    
    - jsonCodec

    # Decides the Apama event type of incoming UM messages
    - classifierCodec:
        rules:
          - apamax.connectivity.MyEvent:
              - metadata.sag.type: apamax.connectivity.MyEvent

    # temporarily use this to show what is being sent/received
    - diagnosticCodec
    
    # convert between (JSON) strings and the binary UTF-8 buffers used by UM 
    - UMStringCodec:
        nullTerminated: true

    - UMTransport:
        channelPattern: "um:.*"

… and a simple event def and monitor:


package apamax.connectivity;

event MyEvent
{
	string message;
	integer number;
	dictionary<string,string> moreInfo;
}

monitor MyMonitor
{
	integer i;
	
	action onload() 
	{
		on all wait(3.0)
		{
			i := i+1;
			send MyEvent("Hello world", i, {"somekey":"somevalue"}) to "um:mytopic";
		}
		
		monitor.subscribe("um:mytopic");
		on all MyEvent() as e
		{
			log "Received event from UM: "+e.toString();
		}
		
		// indicate we're ready to receive events
		com.softwareag.connectivity.ConnectivityPlugins.onApplicationInitialized();
	}
}

This is just made up of snippets from the samples and doc.

In our current setup, we have Apama and UM is installed on different servers. We have copied UniversalMessaging folder from the UM server(C:\SoftwareAG\UniversalMessaging) and placed in Apama server (at C:\SoftwareAG\UniversalMessaging) .

We followed the document and made the changes as you mentioned in the above post.

We are using Apama software designer tool to do the development.

But still we are facing the issue. Below are the details of the setup:
Apama:
Apama version : 9.12
Windows Server 2012 R2

UM:
Universal Messaging : 9.8.
Windows Server 2012 R2

Sush,
A fuller response may come from the account team you are also talking to in parallel, but in short you need to be using a consistent set of Software AG products.
The 9.8 version is getting old now (April 2015) and we have made a considerable number of improvements to the integration architectures since that time and have been focussed on trying to make these types of integration both easier and more flexible with less customised code required by the solution developer. Indeed, the Apama “connectivity plugins” architecture did not exist at that time - it would have been Apama 5.3 that worked with UM 9.8.

Unless you have a specific reason not to do so, then we would suggest a new project should use the last versions of the product in the DBP suite, which is currently 9.12, as well as the latest fix packs.

So if this is a new project then we would suggest a 9.12 UM server, and 9.12 Apama (using 9.12 UM client libraries).

If you really need to have Apama talk to an old UM 9.8 server, then you’d need to use a matching Apama 5.3 (and use a mechanism other than connectivity plugins, such as JMS) - but you have much more manual work to deal with the JSON - I wouldn’t recommend it.

Kev