Re: Copy fields from a message of another payload type

Frank Quinn <>

Hi Yury,

You can still do something similar - it's the enum that is deprecated - payloads are still expected to have their own identifier, you just access it with a private method now, namely  mamaMsgImpl_getPayloadId.

Qpid proton actually has something similar which should provide a working reference for this approach:


On Wed, 24 Aug 2016, 16:53 Yury Batrakov, <yury.batrakov@...> wrote:
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.
Openmama-dev mailing list

Join to automatically receive all group messages.