WebSphere Message Broker, Version 8.0.0.7
Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS
See information about the latest product version
See information about the latest product version
Copying a message using a PHPCompute node
Copy an existing message using the PHPCompute node.
When you use a PHPCompute node to copy an existing message, the code required depends on whether or not the annotated evaluate method is defined in the PHP script.
If you use the @MessageBrokerCopyTransform annotation, the new output message and message assembly objects are created automatically. For example:
<?php
class MyNode {
/**
* @MessageBrokerCopyTransform
*/
function evaluate($output_assembly, $input_assembly) {
// $output_assembly refers to the new message
}
}
?>
If you use a plain script without an annotated evaluate method, you must create the output message and message assembly objects explicitly:
<?php
// create a copy of the input message
$output_message = new MbsMessage($assembly[MB_MESSAGE]);
// a new output message assembly must be created to hold this new message
$output_assembly = new MbsMessageAssembly($assembly, $output_message);
?>