## Out of Process : Consumer : Is correlation on a different method?

This section is used to specify the correlation read point, if your continuing transaction is different from where your correlated payload needs to be read.

- Example 1 (Nested)

package com.packagename;
public class ConsumerClassName {
private void receive() {
continuingTransaction(inStream);
}
private void continuingTransaction(Stream inStream) {
CustomPayload payload = readCorrelation(inStream);
payload.getMessage();
}

private CustomPayload readCorrelation(Stream inStream) {
CustomPayload payload = inStream.readObject();
return payload;
}

}

In the above example continuingTransaction(Stream inStream) of class com.packagename.ConsumerClassName is the continuing transaction while, readCorrelation(Stream inStream) of class com.packagename.ConsumerClassName is the nested method that reads the correlation header from the payload.

Values to put in this section of the tool for the above example.
Match Type: Matches Class
Full Class Name: com.yourpackagename.ConsumerClassName
Method Name: readCorrelation
Method Parameters: Stream inStream

package com.packagename;
public class ConsumerClassName {
private void receive() {
CustomPayload payload = readCorrelation(instream);
// do some work
continuingTransaction(payload);
}
private void continuingTransaction(CustomPayload payload) {
payload.getMessage();
}

private CustomPayload readCorrelation(Stream inStream) {
CustomPayload payload = inStream.readObject();
return payload;
}

}

In the above example continuingTransaction(CustomPayload payload) of class com.packagename.ConsumerClassName is the continuing transaction which is called downstream, while readCorrelation(Stream inStream) of class com.packagename.ConsumerClassName is the called first that reads the correlation header from the payload.

Values to put in this section of the tool for the above example.
Match Type: Matches Class
Full Class Name: com.yourpackagename.ConsumerClassName
Method Name: readCorrelation
Method Parameters: Stream inStream