package com.megatim.apifdxweb.service.impl.camel.routes.in;
|
|
import com.megatim.apifdxweb.service.impl.camel.consumers.ApiTokenMessageConsumer;
|
import com.megatim.fdxcommons.model.jms.messages.ApiTokenMessage;
|
import com.megatim.fdxcommons.tools.CommonAppContext;
|
import com.megatim.fdxcommons.tools.resolvers.JacksonMapperFormat;
|
import javax.enterprise.context.ApplicationScoped;
|
import org.apache.camel.builder.RouteBuilder;
|
|
/**
|
*
|
* @author ASUS
|
*/
|
@ApplicationScoped
|
public class TokenAuthentificationRoute extends RouteBuilder {
|
|
@Override
|
public void configure() throws Exception {
|
|
onException(Exception.class)
|
.process(exchange -> {
|
exchange.getException().printStackTrace();
|
})
|
.handled(true);
|
|
from("rabbitmq:"
|
+ CommonAppContext.TOKEN_GENERATION_EXCHANGE
|
+ "?queue=" + CommonAppContext.TOKEN_GENERATION_QUEUE
|
+ "&routingKey=" + CommonAppContext.TOKEN_GENERATION_ROUTING_KEY
|
+ "&autoDelete=false")
|
.transacted()
|
.unmarshal(JacksonMapperFormat.jacksonDataFormat(ApiTokenMessage.class))
|
.bean(ApiTokenMessageConsumer.class);
|
|
}
|
}
|