Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save estebanroblesluna/966379 to your computer and use it in GitHub Desktop.
Save estebanroblesluna/966379 to your computer and use it in GitHub Desktop.
public class SplitAndSetFieldsProcessor implements MessageProcessor
{
private static String[] fields = new String[] {"FirstName", "LastName", "Email", "Title", "Phone"};
public MuleEvent process(MuleEvent event) throws MuleException
{
String[] values = event.getMessageAsString().split(",");
for (int i = 0; i < values.length; i++)
{
String value = values[i];
event.getMessage().setProperty(fields[i], value, PropertyScope.OUTBOUND);
}
return event;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment