Open topic with navigation

# Reusing Message Objects

It is faster to reuse an existing message object than to destroy it and create a new one. Programs can gain efficiency by reusing message objects, whenever possible.

- If a program repeatedly sends the exact same message content, then the best practice is to create that message object only once, sending it many times.
- If a program sends many messages of the same format, with the same fields, but with varying field values, then the best practice is to reuse one message object, clearing and modifying individual field values appropriately before each send call.
- If a program sends many messages of the same format, but the set of fields varies, then the best practice is to reuse one message object, clearing all of its fields and setting new values before each send call.

A program that sends a limited variety of messages can combine these tactics for reusing message objects. For each send call, it can select an appropriate message from a set of pre-constructed message objects, and modify as needed. To determine the optimum way to combine these tactics, test performance empirically.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO FTL® - Enterprise Edition

Copyright © 2009-2024. Cloud Software Group, Inc. All Rights Reserved.