Fixed some issues with Messaging configuration and copy/paste error
This commit is contained in:
parent
fdcd0fb40b
commit
5296c2b042
@ -14,7 +14,7 @@ import com.knecon.fforesight.tenantcommons.queue.TenantMessagingConfiguration;
|
||||
@Configuration
|
||||
public class TenantMessagingConfigurationImpl extends TenantMessagingConfiguration {
|
||||
|
||||
public String getTenantSyncQueue() {
|
||||
public String getTenantSyncQueueName() {
|
||||
|
||||
return this.getQueueNameWithSuffix("_tenant_sync");
|
||||
}
|
||||
@ -23,7 +23,7 @@ public class TenantMessagingConfigurationImpl extends TenantMessagingConfigurati
|
||||
@Bean({"tenantSyncQueue"})
|
||||
public Queue tenantSyncQueue() {
|
||||
|
||||
return QueueBuilder.durable(this.getTenantCreatedQueueName())
|
||||
return QueueBuilder.durable(this.getTenantSyncQueueName())
|
||||
.withArgument("x-dead-letter-exchange", "")
|
||||
.withArgument("x-dead-letter-routing-key", this.getTenantEventsDLQName())
|
||||
.withArgument("x-expires", 300000)
|
||||
|
||||
@ -18,19 +18,9 @@ public class TenantCreatedListener {
|
||||
|
||||
private final TenantLiquibaseInitializer tenantLiquibaseInitializer;
|
||||
|
||||
@Value("${fforesight.multitenancy.tenant-created-queue:tenant-created-queue}")
|
||||
private String tenantCreatedQueue;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void postConstruct() {
|
||||
|
||||
log.info("Listener for tenant-created started for queue: {}", tenantCreatedQueue);
|
||||
}
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
@RabbitListener(queues = "${fforesight.multitenancy.tenant-created-queue:tenant-created-queue}")
|
||||
@RabbitListener(queues = "#{tenantMessagingConfigurationImpl.getTenantCreatedQueueName()}")
|
||||
public void createTenant(TenantCreatedEvent tenantRequest) {
|
||||
|
||||
tenantLiquibaseInitializer.initializeTenant(tenantRequest.getTenantId());
|
||||
|
||||
@ -22,8 +22,8 @@ public class TenantSyncListener {
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
@RabbitListener(queues = "#{tenantMessagingConfigurationImpl.getTenantSyncQueue()}")
|
||||
public void createTenant(TenantSyncEvent tenantSyncEvent) {
|
||||
@RabbitListener(queues = "#{tenantMessagingConfigurationImpl.getTenantSyncQueueName()}")
|
||||
public void syncTenant(TenantSyncEvent tenantSyncEvent) {
|
||||
|
||||
tenantSyncServices.ifPresent(t -> t.syncTenant(tenantSyncEvent));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user