Copy fields from a message of another payload type

Yury Batrakov

Classification: Public

Hi everyone,

I'm migrating my middleware and payload bridges to OpenMAMA 2.4.1. What I found is that the number of functions were deprecated in new release, for example mamaMsg_getPayloadType. In my bridge I support sending data of other payload types and this deprecation breaks my code. Could you advise how to port the following pseudo code to 2.4.1?

send_message(msg) {
if(mamaMsg_getPayloadType(msg) == MY_TYPE) {
bytes = serialize_fast(msg);
} else {
// Create a new message of my type and copy all fields from original message to it
copy = mamaMsg_create();
mamaMsg_iterateFields(msg, copy_each_field, copy);

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.

Join to automatically receive all group messages.