private CoreEvent createMuleEvent(Message message, int numProperties) { final Builder builder; try { builder = CoreEvent.builder(create(flow, CONNECTOR_LOCATION)).message(message); } catch (Exception e) { throw new RuntimeException(e); } for (int i = 1; i <= numProperties; i++) { builder.addVariable("FlOwVaRiAbLeKeY" + i, "val"); } return builder.build(); }
@Benchmark public CoreEvent addEventVariableEventWith50VariablesProperties() { return CoreEvent.builder(eventWith50VariablesProperties).addVariable(KEY, VALUE).build(); }
private Processor createSetStringMessageProcessor(final String appendText) { return event -> { return CoreEvent.builder(event).message(InternalMessage.builder(event.getMessage()).value(appendText).build()).build(); }; }
/** * {@inheritDoc} * * @return {@link ExecutionContextAdapter#getEvent()} */ @Override public CoreEvent asReturnValue(Object value, ExecutionContextAdapter operationContext) { return CoreEvent.builder(operationContext.getEvent()).securityContext(operationContext.getSecurityContext()).build(); } }
@Override public CoreEvent process(CoreEvent event) throws MuleException { correlationId = event.getCorrelationId(); return event; } }
private CoreEvent createEventToSerialize() throws Exception { createAndRegisterTransformersEndpointBuilderService(); return testEvent(); }
@Benchmark public CoreEvent addEventVariable() { return CoreEvent.builder(event).addVariable(KEY, VALUE).build(); }
@Benchmark public CoreEvent addEventVariableEventWith20VariablesProperties() { return CoreEvent.builder(eventWith10VariablesProperties).addVariable(KEY, VALUE).build(); }
@Benchmark public CoreEvent addEventVariableEventWith100VariablesProperties() { return CoreEvent.builder(eventWith100VariablesProperties).addVariable(KEY, VALUE).build(); }