class WorkerConfiguration {

	private final RemotePartitioningWorkerStepBuilderFactory workerStepBuilderFactory;

	public WorkerConfiguration(RemotePartitioningWorkerStepBuilderFactory workerStepBuilderFactory) {
		this.workerStepBuilderFactory = workerStepBuilderFactory;
	}

	/*
	 * Configure inbound flow (requests coming from the manager)
	 */
	@Bean
	public DirectChannel requests() {
		return new DirectChannel();
	}

	@Bean
	public IntegrationFlow inboundFlow(ActiveMQConnectionFactory connectionFactory) {
		return IntegrationFlow.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("requests"))
			.channel(requests())
			.get();
	}

	/*
	 * Configure outbound flow (replies going to the manager)
	 */
	@Bean
	public DirectChannel replies() {
		return new DirectChannel();
	}

	@Bean
	public IntegrationFlow outboundFlow(ActiveMQConnectionFactory connectionFactory) {
		return IntegrationFlow.from(replies())
			.handle(Jms.outboundAdapter(connectionFactory).destination("replies"))
			.get();
	}

	/*
	 * Configure the worker step
	 */
	@Bean
	public Step workerStep(PlatformTransactionManager transactionManager) {
		return this.workerStepBuilderFactory.get("workerStep")
			.inputChannel(requests())
			.outputChannel(replies())
			.tasklet(tasklet(null), transactionManager)
			.build();
	}

	@Bean
	@StepScope
	public Tasklet tasklet(@Value("#{stepExecutionContext['partition']}") String partition) {<FILL_FUNCTION_BODY>}

}

		return (contribution, chunkContext) -> {
			System.out.println("processing " + partition);
			return RepeatStatus.FINISHED;
		};
	
<no_super_class>