Skip to content

Commit 260a2fb

Browse files
authored
bump damsel (#75)
* bump damsel * fix review * fix review 2
1 parent 5702f7d commit 260a2fb

41 files changed

Lines changed: 35 additions & 1438 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<parent>
1414
<groupId>dev.vality</groupId>
1515
<artifactId>service-parent-pom</artifactId>
16-
<version>3.1.1</version>
16+
<version>3.1.4</version>
1717
</parent>
1818

1919
<properties>
Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
package dev.vality.hooker.configuration;
22

3-
import dev.vality.damsel.payment_processing.CustomerManagementSrv;
43
import dev.vality.damsel.payment_processing.InvoicingSrv;
5-
import dev.vality.hooker.configuration.meta.UserIdentityIdExtensionKit;
6-
import dev.vality.hooker.configuration.meta.UserIdentityRealmExtensionKit;
74
import dev.vality.woody.thrift.impl.http.THSpawnClientBuilder;
85
import org.springframework.beans.factory.annotation.Value;
96
import org.springframework.context.annotation.Bean;
107
import org.springframework.context.annotation.Configuration;
118
import org.springframework.core.io.Resource;
129

1310
import java.io.IOException;
14-
import java.util.List;
1511

1612
@Configuration
1713
public class HgConfig {
@@ -23,16 +19,4 @@ public InvoicingSrv.Iface invoicingClient(@Value("${service.invoicing.url}") Res
2319
.withNetworkTimeout(networkTimeout)
2420
.withAddress(resource.getURI()).build(InvoicingSrv.Iface.class);
2521
}
26-
27-
@Bean
28-
public CustomerManagementSrv.Iface customerClient(@Value("${service.customer.url}") Resource resource,
29-
@Value("${service.customer.networkTimeout}") int networkTimeout)
30-
throws IOException {
31-
return new THSpawnClientBuilder()
32-
.withMetaExtensions(List.of(
33-
UserIdentityIdExtensionKit.INSTANCE,
34-
UserIdentityRealmExtensionKit.INSTANCE))
35-
.withNetworkTimeout(networkTimeout)
36-
.withAddress(resource.getURI()).build(CustomerManagementSrv.Iface.class);
37-
}
3822
}

src/main/java/dev/vality/hooker/configuration/KafkaConfig.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public class KafkaConfig {
3535

3636
@Value("${kafka.topics.invoice.concurrency}")
3737
private int invoicingConcurrency;
38-
@Value("${kafka.topics.customer.concurrency}")
39-
private int customerConcurrency;
4038

4139
private final KafkaProperties kafkaProperties;
4240

@@ -68,21 +66,6 @@ public KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String,
6866
return factory;
6967
}
7068

71-
@Bean
72-
@SuppressWarnings("LineLength")
73-
public KafkaListenerContainerFactory<ConcurrentMessageListenerContainer<String, MachineEvent>> customerListenerContainerFactory(
74-
ConsumerFactory<String, MachineEvent> consumerFactory
75-
) {
76-
ConcurrentKafkaListenerContainerFactory<String, MachineEvent> factory =
77-
new ConcurrentKafkaListenerContainerFactory<>();
78-
factory.setConsumerFactory(consumerFactory);
79-
factory.setBatchListener(false);
80-
factory.getContainerProperties().setAckMode(ContainerProperties.AckMode.MANUAL);
81-
factory.setCommonErrorHandler(ExponentialBackOffDefaultErrorHandlerFactory.create());
82-
factory.setConcurrency(customerConcurrency);
83-
return factory;
84-
}
85-
8669
@Bean
8770
public BinaryDeserializer<EventPayload> paymentEventPayloadDeserializer() {
8871
return new PaymentEventPayloadDeserializer();

src/main/java/dev/vality/hooker/configuration/KafkaConsumerConfig.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package dev.vality.hooker.configuration;
22

3-
import dev.vality.hooker.listener.CustomerEventKafkaListener;
43
import dev.vality.hooker.listener.InvoicingEventKafkaListener;
54
import dev.vality.hooker.listener.MachineEventHandler;
65
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -17,10 +16,4 @@ public class KafkaConsumerConfig {
1716
public InvoicingEventKafkaListener paymentEventsKafkaListener(MachineEventHandler invoicingMachineEventHandler) {
1817
return new InvoicingEventKafkaListener(invoicingMachineEventHandler);
1918
}
20-
21-
@Bean
22-
@ConditionalOnProperty(value = "kafka.topics.customer.enabled", havingValue = "true")
23-
public CustomerEventKafkaListener customerEventsKafkaListener(MachineEventHandler customerMachineEventHandler) {
24-
return new CustomerEventKafkaListener(customerMachineEventHandler);
25-
}
2619
}

src/main/java/dev/vality/hooker/configuration/RowMapperConfig.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package dev.vality.hooker.configuration;
22

33
import dev.vality.hooker.dao.rowmapper.WebhookModelRowMapper;
4-
import dev.vality.hooker.model.CustomerMessage;
54
import dev.vality.hooker.model.InvoicingMessage;
65
import dev.vality.hooker.model.WebhookMessageModel;
76
import org.springframework.context.annotation.Bean;
@@ -10,11 +9,6 @@
109

1110
@Configuration
1211
public class RowMapperConfig {
13-
@Bean
14-
public RowMapper<WebhookMessageModel<CustomerMessage>> customerWebhookRowMapper(
15-
RowMapper<CustomerMessage> customerRowMapper) {
16-
return new WebhookModelRowMapper<>(customerRowMapper);
17-
}
1812

1913
@Bean
2014
public RowMapper<WebhookMessageModel<InvoicingMessage>> invoicingWebhookRowMapper(

src/main/java/dev/vality/hooker/configuration/ServiceConfig.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import dev.vality.hooker.converter.WebhookMessageBuilder;
44
import dev.vality.hooker.dao.MessageDao;
5-
import dev.vality.hooker.model.CustomerMessage;
65
import dev.vality.hooker.model.InvoicingMessage;
76
import dev.vality.hooker.service.EventService;
87
import dev.vality.hooker.service.MessageService;
@@ -19,13 +18,4 @@ public MessageService<InvoicingMessage> invoicingService(MessageDao<InvoicingMes
1918
WebhookKafkaProducerService webhookKafkaProducerService) {
2019
return new MessageService<>(messageDao, eventService, webhookMessageBuilder, webhookKafkaProducerService);
2120
}
22-
23-
@Bean
24-
public MessageService<CustomerMessage> customerService(MessageDao<CustomerMessage> messageDao,
25-
EventService<CustomerMessage> eventService,
26-
WebhookMessageBuilder webhookMessageBuilder,
27-
WebhookKafkaProducerService webhookKafkaProducerService) {
28-
return new MessageService<>(messageDao, eventService, webhookMessageBuilder, webhookKafkaProducerService);
29-
}
30-
3121
}

src/main/java/dev/vality/hooker/converter/CustomerBindingConverter.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/main/java/dev/vality/hooker/converter/CustomerConverter.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/main/java/dev/vality/hooker/converter/PaymentConverter.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ public ExpandedPayment convert(InvoicePayment sourceWrapper, Invoice invoice) {
5050

5151
if (source.getPayer().isSetPaymentResource()) {
5252
setResourcePaymentTool(source, target);
53-
} else if (source.getPayer().isSetCustomer()) {
54-
setCustomerPaymentTool(source, target);
5553
} else if (source.getPayer().isSetRecurrent()) {
5654
setRecurrentPaymentTool(source, target);
5755
}
@@ -132,17 +130,6 @@ private void setRecurrentPaymentTool(dev.vality.damsel.domain.InvoicePayment sou
132130
.phoneNumber(recurrentParentOrigin.getContactInfo().getPhoneNumber()));
133131
}
134132

135-
private void setCustomerPaymentTool(dev.vality.damsel.domain.InvoicePayment source, Payment target) {
136-
dev.vality.damsel.domain.CustomerPayer customerPayerOrigin = source.getPayer().getCustomer();
137-
target.paymentToolToken(PaymentToolUtils.getPaymentToolToken(customerPayerOrigin.getPaymentTool()))
138-
.contactInfo(new PaymentContactInfo()
139-
.email(customerPayerOrigin.getContactInfo().getEmail())
140-
.phoneNumber(customerPayerOrigin.getContactInfo().getPhoneNumber()))
141-
.payer(new CustomerPayer()
142-
.customerID(source.getPayer().getCustomer().getCustomerId())
143-
.payerType(Payer.PayerTypeEnum.CUSTOMER_PAYER));
144-
}
145-
146133
private boolean isSetAdditionalInfo(InvoicePayment sourceWrapper) {
147134
return (!sourceWrapper.getSessions().isEmpty())
148135
&& sourceWrapper.getSessions().get(0).isSetTransactionInfo()

src/main/java/dev/vality/hooker/dao/CustomerDao.java

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)