When trying to publish a platform event from our middleware solution (Boomi) to our salesforce instance, I'm receiving a 400/Bad request (this was intermittent, as some would process without issue). The only time that this would happen is when the large text field I was feeding a payload string into had a UTF-8 encoded char.

Does anyone know if platform events are default encoded as non-UTF-8?

**Fortunately I'm just going to encode in base64 and then decode within my apex trigger helper class, so it should work okay. I don't like adding to the CPU overhead by doing this, however...

  • Strings inside Salesforce are always encoded in UTF-8, but there's definitely some circumstances where the API doesn't interpret incoming data as UTF-8. Here is one example. Can you tell if any encoding headers are being sent? – David Reed Feb 2 '18 at 16:47
  • Not to my knowledge, as the "connector" used in Boomi to publish the events aren't super configurable. One of the major drawbacks of using Boomi; there is a lot of data that is configured behind the scenes that you can't access (not just this particular connection type) @David Reed – Nathan Lee Feb 2 '18 at 17:06
  • everything incoming to SFDC has to be UTF-8 if text; it would be an error on the Boomi side if the text prior to publishing as a platform event is non UTF-8 – cropredy Feb 3 '18 at 6:21
  • @cropredy yeah I think you're right, after debugging a bit more it seems Boomi's default charset for their platform events connector is something other than Unicode. And their isn't any way to change the encoding... not a huge surprise coming from that platform; Boomi has given me tons of little issues like this all over the place. – Nathan Lee Feb 3 '18 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.