I don’t think you’re missing anything. The problem is the AssignMessage policy treats every variable as a string. Your mpf_item_content_1 contains a byte array with the actual image contents, but when AssignMessage coerces it to a string, it gets the result of Java’s .toString() method on the byte array, which renders a string starting with [B@ followed by a unique identifier. That is a representation of the byte array that is internal to the Java VM. Obviously not what you want.
This is why above I said “that might do it.” I wasn’t sure if AssignMessage would be smart enough to look at the type of the object stored in the referred variable, and then do the right thing. Apparently it is not smart enough to do that. I think it’s a reasonable change request to ask that AssignMessage do the right thing, but … even if that request is accepted, it will take a while for it to become available.
The workaround I can think of is to use an additional, as-yet-unwritten Java callout, to set the response.content to the right thing. It’s a really simple thing, a few lines of Java, but it does not yet exist. I could work on producing that. It seems like a reasonable complement to the multi-part form parser, which always returns byte arrays.
EDIT - Thursday, 1 April 2021, 09:05
I just updated the multipart form callout to add a ContentSetter callout that does this. Check the repo (git pull), and you should see the new callout.
Usage would be like this:
<JavaCallout name='Java-SetContent>
<Properties>
<Property name="destination">message</Property>
<Property name="contentVar">mpf_item_content_1</Property>
<Property name="contentType">{mpf_item_content-type_1}</Property>
</Properties>
<ClassName>com.google.apigee.callouts.ContentSetter</ClassName>
<ResourceURL>java://apigee-multipart-form-20210401.jar</ResourceURL>
</JavaCallout>
Use this in lieu of the AssignMessage I suggested above.
But I’m still not clear - why set response.content? I thought you wanted to send this thing to S3? Maybe you’re using response.content just as a step while debugging the thing, eh?