OpenMAMA plugin enhancement to allow source/symbol-mapping plugin

Keith Rudd

I took an action from recent OpenMAMA Steering Committee meeting to look into MAMA plugin interface enhancement, specifically with a view to providing for a pre-subscription plugin hook that would allow for a custom symbol mapper and/or subscription logger plugin.


I've had a look at the OpenMAMA 6.3.0 code with this in mind and have concluded the following.


There is now a 'subscriptionPostCreate' hook defined:

typedef mama_status (*mamaPlugin_subscriptionPostCreateHook) (mamaPluginInfo pluginInfo, mamaSubscription subscription);

It gets called once and only from mamaSubscription_setupBasic() in subscription.c

This could be used for subscription logging, but would not be useful for symbol mapping for a couple of reasons.

One is that it occurs after some initializations for activating the subscription have taken place, namely calls to mamaPublisherImpl_createByIndex() and image_request(), both of which use the originally specified source and symbol.

The other is that there is currently no way of resetting the subscription source after mamaSubscription_create() anyway.


Two changes are needed for a plugin hook that does source/symbol mapping (changes source and/or symbol) to be practical I think.


1) A plugin hook at a slightly earlier point in mamaSubscription_setupBasic().

I suggest just after line 605 in subscription.c, where a call to setSubscInfo (self, transport, root, source, symbol) is made.

After this point, source and symbol are stored in the mamaSubscriptionImpl struct and only used from the stored values,  so if set (changed) then changes will be effective.

Could implement either by moving the 'subscriptionPostCreateHook' to this slightly earlier point, or by just creating a new additional plugin, say called 'subscriptionPostSetUpHook', inserted at this point.

I slightly prefer the second choice, but OK either way.


2) Add an additional accessor function for mamaSubscription,

mama_status mamaSubscription_setSourceName (mamaSubscription subscription, const char* sourceName)

This would be very similar to the mamaSubscription_setSymbol() function, just changing sourceName (mSubscSource in mamaSubscriptionImpl struct) instead.


These are the changes I propose.




This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to for additional EU corporate and regulatory disclosures and to for information about privacy.