-
Notifications
You must be signed in to change notification settings - Fork 30
/
spring-billing-disruptor.xml
executable file
·92 lines (78 loc) · 4.31 KB
/
spring-billing-disruptor.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--
| journalBillingEventProcessor | billingBusinessEventProcessor |
| / | / |
| / | / |
billingEventPublisher -> Ring Buffer ->| - | - corporateBillingBusinessEventProcessor | -billingOutboundFormattingEventProcessor
| \ | \ |
| \ | \ |
| billingValidationEventProcessor | customerSpecificBillingBusinessEventProcessor |
-->
<bean id="billingDisruptor" class="org.anair.disruptor.DefaultDisruptorConfig"
init-method="init" destroy-method="controlledShutdown">
<property name="threadName" value="billingThread" />
<property name="eventFactory">
<bean
class="org.anair.billing.disruptor.eventfactory.BillingEvent" />
</property>
<property name="eventHandlerChain">
<array>
<bean class="org.anair.disruptor.EventHandlerChain" scope="prototype">
<constructor-arg name="currentEventHandlers">
<array value-type="com.lmax.disruptor.EventHandler">
<ref bean="journalBillingEventProcessor" />
<ref bean="billingValidationEventProcessor" />
</array>
</constructor-arg>
<constructor-arg name="nextEventHandlers">
<array value-type="com.lmax.disruptor.EventHandler">
<ref bean="billingBusinessEventProcessor" />
<ref bean="corporateBillingBusinessEventProcessor" />
<ref bean="customerSpecificBillingBusinessEventProcessor" />
</array>
</constructor-arg>
</bean>
<bean class="org.anair.disruptor.EventHandlerChain" scope="prototype">
<constructor-arg name="currentEventHandlers">
<array value-type="com.lmax.disruptor.EventHandler">
<ref bean="billingBusinessEventProcessor" />
<ref bean="corporateBillingBusinessEventProcessor" />
<ref bean="customerSpecificBillingBusinessEventProcessor" />
</array>
</constructor-arg>
<constructor-arg name="nextEventHandlers">
<array value-type="com.lmax.disruptor.EventHandler">
<ref bean="billingOutboundFormattingEventProcessor" />
</array>
</constructor-arg>
</bean>
</array>
</property>
</bean>
<!-- Event Processors/Consumers -->
<bean id="journalBillingEventProcessor"
class="org.anair.billing.disruptor.eventprocessor.JournalBillingEventProcessor"
p:billingService-ref="billingService"/>
<bean id="billingValidationEventProcessor"
class="org.anair.billing.disruptor.eventprocessor.BillingValidationEventProcessor"
p:billingService-ref="billingService"/>
<bean id="billingOutboundFormattingEventProcessor"
class="org.anair.billing.disruptor.eventprocessor.BillingOutboundFormattingEventProcessor"
p:billingService-ref="billingService"/>
<bean id="billingBusinessEventProcessor"
class="org.anair.billing.disruptor.eventprocessor.BillingBusinessEventProcessor"
p:billingService-ref="billingService"/>
<bean id="corporateBillingBusinessEventProcessor"
class="org.anair.billing.disruptor.eventprocessor.CorporateBillingBusinessEventProcessor"
p:billingService-ref="billingService"/>
<bean id="customerSpecificBillingBusinessEventProcessor"
class="org.anair.billing.disruptor.eventprocessor.CustomerSpecificBillingBusinessEventProcessor"
p:billingService-ref="billingService"/>
<!-- Publisher -->
<bean id="billingEventPublisher"
class="org.anair.billing.disruptor.publisher.BillingEventPublisher"
p:disruptorConfig-ref="billingDisruptor" />
</beans>