Open topic with navigation

TIBCO Rendezvous® 8.8.0

# Replace and Merge

Replace & Merge

`rvcache` can store message data in two ways. For each subject, it can either replace all previously stored data with the contents of each new message, or it can merge information from the fields of the message into the stored data, overwriting only those fields specified in the new message.

Select one of these two storage methods each time you add a subject.

Shallow & Deep Merge

Furthermore, `rvcache` can merge data in either of two ways. The command line parameter `-merge` selects either shallow merge or deep merge as the behavior of the cache, consistent for all merged subjects. Consider a new message that contains nested messages as field values.

| • | Shallow merge replaces the old field value with the new nested message as an indivisible unit, without special treatment for the individual fields of the nested message. That is, merging occurs at only one level of nesting; level-one fields replace level-one fields.

| • | Deep merge inspects the fields of nested messages, and recursively merges the fields of a new nested message into fields of a stored nested message. Merging continues recursively to any depth of nesting.

Example

rvcache Replace and Merge presents an example, contrasting the different behavior of replacement, shallow merge and deep merge.

rvcache Replace and Merge

Stored Message | Replace | Shallow Merge | Deep Merge
    {
     Field1 1.0
     Field2 "a str"
     Field4 {
          Sub1 2.0
          Sub2 "c str"
            }
    }
    {
     Field3 "b str"
     Field4 {
         Sub1 3.0
            }
    }
The new message (in this column) replaces the stored message as an indivisible unit. After replacement, the stored message is an identical copy of the new message. |
    {
     Field1 1.0
     Field2 "a str"
     Field3 "b str"
     Field4 {
         Sub1 3.0
            }
    }
Fields of the stored message remain in place, except where superseded by the fields of the new message. Existing `Field1` and `Field2` remain unchanged. The new `Field3` is added to the stored message. The new value of `Field4` replaces the stored value. |
    {
     Field1 1.0
     Field2 "a str"
     Field3 "b str"
     Field4 {
         Sub1 3.0
         Sub2 "c str"
            }
    }
Existing `Field1` and `Field2` remain unchanged. The new `Field3` is added to the stored message. The new value of `Field4` recursively merges into the stored value, replacing the value of `Sub1`, but leaving `Sub2` unchanged.

Data stored in `rvcache` never expires. It remains in the cache until superseded or augmented by data from a new message on the same subject.

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 Rendezvous®

Copyright © 1997-2025. Cloud Software Group, Inc. All Rights Reserved.