final List<UnmarshalledExtension> requestExtensions = ExtensionAccess.getProducerExtensionAccessor().getRequestExtensionsFor(MarkupParams.class);
if (!requestExtensions.isEmpty())
{
// ideally, you should check here that you really got the extension you expected but we're assuming here that we got exactly what we're expecting
final UnmarshalledExtension unmarshalledExtension = requestExtensions.get(0);
if (unmarshalledExtension.isElement())
{
// get the text content which should be the session id that the consumer passed
final Element element = (Element)unmarshalledExtension.getValue();
final String textContent = element.getTextContent();
// and put the value in the session so that the portlet the invocation targets can use it
invocation.getRequest().getSession().setAttribute("consumerSaid", textContent);
}