regards,
Nitin
1 > POST http://127.0.0.1:8080/1.0/kb/accounts
1 > host: 127.0.0.1:8080
1 > content-type: application/json; charset=utf-8
1 > x-killbill-createdby: ccb
1 > x-killbill-reason: userrequest
1 > x-killbill-comment: client impletentation
1 > x-killbill-apikey: bob
1 > x-killbill-apisecret: lazar
1 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
1 > connection: keep-alive
1 > accept: */*
1 > user-agent: NING/1.0
1 > content-length: 505
1 >
12:50:23.444 [http-bio-8080-exec-5] INFO c.s.j.a.c.filter.LoggingFilter - 1 * Server out-bound response
1 < 201
1 < Location: http://127.0.0.1:8080/1.0/kb/accounts/82126928-1441-4e1b-8ea6-1c6ef06a828c
1 < Content-Type: application/json
1 <
12:50:23.804 [http-bio-8080-exec-9] INFO c.s.j.a.c.filter.LoggingFilter - 2 * Server in-bound request
2 > GET http://127.0.0.1:8080/1.0/kb/accounts?externalKey=59f7afbf-254e-4ea8-a29d-c300eb2e991f
2 > host: 127.0.0.1:8080
2 > content-type: application/json; charset=utf-8
2 > x-killbill-createdby:
2 > x-killbill-reason:
2 > x-killbill-comment:
2 > x-killbill-apikey: bob
2 > x-killbill-apisecret: lazar
2 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
2 > connection: keep-alive
2 > accept: */*
2 > user-agent: NING/1.0
2 >
12:50:23.830 [http-bio-8080-exec-9] INFO c.s.j.a.c.filter.LoggingFilter - 2 * Server out-bound response
2 < 200
2 < Content-Type: application/json
2 <
12:50:24.299 [http-bio-8080-exec-3] INFO c.s.j.a.c.filter.LoggingFilter - 3 * Server in-bound request
3 > POST http://127.0.0.1:8080/1.0/kb/accounts/82126928-1441-4e1b-8ea6-1c6ef06a828c/paymentMethods?isDefault=true
3 > host: 127.0.0.1:8080
3 > content-type: application/json; charset=utf-8
3 > x-killbill-createdby: ccb
3 > x-killbill-reason: userrequest
3 > x-killbill-comment: client impletentation
3 > x-killbill-apikey: bob
3 > x-killbill-apisecret: lazar
3 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
3 > connection: keep-alive
3 > accept: */*
3 > user-agent: NING/1.0
3 > content-length: 391
3 >
12:50:24.710 [http-bio-8080-exec-3] INFO c.s.j.a.c.filter.LoggingFilter - 3 * Server out-bound response
3 < 201
3 < Location: http://127.0.0.1:8080/1.0/kb/paymentMethods/8a96f19b-0026-4517-b5b1-145e52263494
3 < Content-Type: application/json
3 <
12:50:25.528 [http-bio-8080-exec-2] INFO c.s.j.a.c.filter.LoggingFilter - 4 * Server in-bound request
4 > GET http://127.0.0.1:8080/1.0/kb/accounts?externalKey=59f7afbf-254e-4ea8-a29d-c300eb2e991f
4 > host: 127.0.0.1:8080
4 > content-type: application/json; charset=utf-8
4 > x-killbill-createdby:
4 > x-killbill-reason:
4 > x-killbill-comment:
4 > x-killbill-apikey: bob
4 > x-killbill-apisecret: lazar
4 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
4 > connection: keep-alive
4 > accept: */*
4 > user-agent: NING/1.0
4 >
12:50:25.549 [http-bio-8080-exec-2] INFO c.s.j.a.c.filter.LoggingFilter - 4 * Server out-bound response
4 < 200
4 < Content-Type: application/json
4 <
12:50:26.947 [http-bio-8080-exec-5] INFO c.s.j.a.c.filter.LoggingFilter - 5 * Server in-bound request
5 > POST http://127.0.0.1:8080/1.0/kb/subscriptions
5 > host: 127.0.0.1:8080
5 > content-type: application/json; charset=utf-8
5 > x-killbill-createdby: ccb
5 > x-killbill-reason: userrequest
5 > x-killbill-comment: client impletentation
5 > x-killbill-apikey: bob
5 > x-killbill-apisecret: lazar
5 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
5 > connection: keep-alive
5 > accept: */*
5 > user-agent: NING/1.0
5 > content-length: 424
5 >
12:50:27.792 [http-bio-8080-exec-5] INFO c.s.j.a.c.filter.LoggingFilter - 5 * Server out-bound response
5 < 201
5 < Location: http://127.0.0.1:8080/1.0/kb/subscriptions/681b2765-69da-4b25-bdda-acde03674b25
5 < Content-Type: application/json
5 <
12:50:28.094 [http-bio-8080-exec-5] INFO c.s.j.a.c.filter.LoggingFilter - 6 * Server in-bound request
6 > GET http://127.0.0.1:8080/1.0/kb/subscriptions/681b2765-69da-4b25-bdda-acde03674b25
6 > host: 127.0.0.1:8080
6 > content-type: application/json; charset=utf-8
6 > x-killbill-createdby: ccb
6 > x-killbill-reason: userrequest
6 > x-killbill-comment: client impletentation
6 > x-killbill-apikey: bob
6 > x-killbill-apisecret: lazar
6 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
6 > connection: keep-alive
6 > accept: */*
6 > user-agent: NING/1.0
6 >
12:50:28.375 [http-bio-8080-exec-5] INFO c.s.j.a.c.filter.LoggingFilter - 6 * Server out-bound response
6 < 200
6 < Content-Type: application/json
6 <
12:50:29.862 [bus-th] INFO c.n.b.j.p.b.BillCycleDayCalculator - Calculated BCD: subscription id 681b2765-69da-4b25-bdda-acde03674b25, subscription start 2013-10-31T07:20:27.000Z, timezone UTC, bcd UTC 31, bcd local 31
12:50:30.048 [bus-th] INFO c.n.b.j.p.b.DefaultInternalBillingApi - Computed billing events for accountId 82126928-1441-4e1b-8ea6-1c6ef06a828c
Billing Events Raw
DefaultBillingEvent{type=CREATE, effectiveDate=2013-10-31T07:20:27.000Z, planPhaseName=frenzo-usage-monthly-evergreen, subscriptionId=681b2765-69da-4b25-bdda-acde03674b25, totalOrdering=75, accountId=82126928-1441-4e1b-8ea6-1c6ef06a828c}
Billing Events After Blocking
DefaultBillingEvent{type=CREATE, effectiveDate=2013-10-31T07:20:27.000Z, planPhaseName=frenzo-usage-monthly-evergreen, subscriptionId=681b2765-69da-4b25-bdda-acde03674b25, totalOrdering=75, accountId=82126928-1441-4e1b-8ea6-1c6ef06a828c}
12:50:30.109 [bus-th] INFO c.n.b.i.g.DefaultInvoiceGenerator - Invoice items generated for invoiceId 6edb7ca3-81c0-4f5e-9b51-8135cac07237 and accountId 82126928-1441-4e1b-8ea6-1c6ef06a828c
DefaultBillingEvent{type=CREATE, effectiveDate=2013-10-31T07:20:27.000Z, planPhaseName=frenzo-usage-monthly-evergreen, subscriptionId=681b2765-69da-4b25-bdda-acde03674b25, totalOrdering=75, accountId=82126928-1441-4e1b-8ea6-1c6ef06a828c}
RECURRING{startDate=2013-10-31, endDate=2013-11-30, amount=5.00, rate=5, subscriptionId=681b2765-69da-4b25-bdda-acde03674b25, linkedItemId=null}
12:50:30.109 [bus-th] INFO c.n.b.invoice.InvoiceDispatcher - Generated invoice 6edb7ca3-81c0-4f5e-9b51-8135cac07237 with 1 items for accountId 82126928-1441-4e1b-8ea6-1c6ef06a828c and targetDate 2013-10-31 (targetDateTime 2013-10-31T07:20:27.000Z)
12:50:30.378 [bus-th] INFO c.n.b.i.n.DefaultNextBillingDatePoster - Queuing next billing date notification at 2013-11-30T07:20:27.000Z for subscriptionId 681b2765-69da-4b25-bdda-acde03674b25
12:50:33.204 [bus-th] INFO c.n.b.payment.bus.InvoiceHandler - Received invoice creation notification for account 82126928-1441-4e1b-8ea6-1c6ef06a828c and invoice 6edb7ca3-81c0-4f5e-9b51-8135cac07237
DO PAYMENT OF 82126928-1441-4e1b-8ea6-1c6ef06a828c::de6cffc3-d073-475e-8b3c-917331358a8e::5.00
12:51:02.284 [http-bio-8080-exec-4] INFO c.s.j.a.c.filter.LoggingFilter - 7 * Server in-bound request
7 > POST http://127.0.0.1:8080/1.0/kb/accounts
7 > host: 127.0.0.1:8080
7 > content-type: application/json; charset=utf-8
7 > x-killbill-createdby: ccb
7 > x-killbill-reason: userrequest
7 > x-killbill-comment: client impletentation
7 > x-killbill-apikey: bob
7 > x-killbill-apisecret: lazar
7 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
7 > connection: keep-alive
7 > accept: */*
7 > user-agent: NING/1.0
7 > content-length: 505
7 >
12:51:02.435 [http-bio-8080-exec-4] INFO c.s.j.a.c.filter.LoggingFilter - 7 * Server out-bound response
7 < 201
7 < Location: http://127.0.0.1:8080/1.0/kb/accounts/9db4dbaa-378d-4cc7-b5d9-f6fa297fea8a
7 < Content-Type: application/json
7 <
12:51:02.730 [http-bio-8080-exec-1] INFO c.s.j.a.c.filter.LoggingFilter - 8 * Server in-bound request
8 > GET http://127.0.0.1:8080/1.0/kb/accounts?externalKey=8375fc5a-a4de-42a0-a3ab-f854c96da51c
8 > host: 127.0.0.1:8080
8 > content-type: application/json; charset=utf-8
8 > x-killbill-createdby:
8 > x-killbill-reason:
8 > x-killbill-comment:
8 > x-killbill-apikey: bob
8 > x-killbill-apisecret: lazar
8 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
8 > connection: keep-alive
8 > accept: */*
8 > user-agent: NING/1.0
8 >
12:51:02.757 [http-bio-8080-exec-1] INFO c.s.j.a.c.filter.LoggingFilter - 8 * Server out-bound response
8 < 200
8 < Content-Type: application/json
8 <
12:51:03.151 [http-bio-8080-exec-11] INFO c.s.j.a.c.filter.LoggingFilter - 9 * Server in-bound request
9 > POST http://127.0.0.1:8080/1.0/kb/accounts/9db4dbaa-378d-4cc7-b5d9-f6fa297fea8a/paymentMethods?isDefault=true
9 > host: 127.0.0.1:8080
9 > content-type: application/json; charset=utf-8
9 > x-killbill-createdby: ccb
9 > x-killbill-reason: userrequest
9 > x-killbill-comment: client impletentation
9 > x-killbill-apikey: bob
9 > x-killbill-apisecret: lazar
9 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
9 > connection: keep-alive
9 > accept: */*
9 > user-agent: NING/1.0
9 > content-length: 391
9 >
12:51:03.468 [http-bio-8080-exec-11] INFO c.s.j.a.c.filter.LoggingFilter - 9 * Server out-bound response
9 < 201
9 < Location: http://127.0.0.1:8080/1.0/kb/paymentMethods/335601c4-ed8e-42bc-ba11-472c2cec86b8
9 < Content-Type: application/json
9 <
12:51:03.749 [http-bio-8080-exec-5] INFO c.s.j.a.c.filter.LoggingFilter - 10 * Server in-bound request
10 > GET http://127.0.0.1:8080/1.0/kb/accounts?externalKey=8375fc5a-a4de-42a0-a3ab-f854c96da51c
10 > host: 127.0.0.1:8080
10 > content-type: application/json; charset=utf-8
10 > x-killbill-createdby:
10 > x-killbill-reason:
10 > x-killbill-comment:
10 > x-killbill-apikey: bob
10 > x-killbill-apisecret: lazar
10 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
10 > connection: keep-alive
10 > accept: */*
10 > user-agent: NING/1.0
10 >
12:51:03.766 [http-bio-8080-exec-5] INFO c.s.j.a.c.filter.LoggingFilter - 10 * Server out-bound response
10 < 200
10 < Content-Type: application/json
10 <
12:51:05.146 [http-bio-8080-exec-2] INFO c.s.j.a.c.filter.LoggingFilter - 11 * Server in-bound request
11 > POST http://127.0.0.1:8080/1.0/kb/subscriptions
11 > host: 127.0.0.1:8080
11 > content-type: application/json; charset=utf-8
11 > x-killbill-createdby: ccb
11 > x-killbill-reason: userrequest
11 > x-killbill-comment: client impletentation
11 > x-killbill-apikey: bob
11 > x-killbill-apisecret: lazar
11 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
11 > connection: keep-alive
11 > accept: */*
11 > user-agent: NING/1.0
11 > content-length: 424
11 >
12:51:05.519 [http-bio-8080-exec-2] INFO c.s.j.a.c.filter.LoggingFilter - 11 * Server out-bound response
11 < 201
11 < Location: http://127.0.0.1:8080/1.0/kb/subscriptions/6e760b12-60fa-4810-9022-742b5e6792ce
11 < Content-Type: application/json
11 <
12:51:05.812 [http-bio-8080-exec-3] INFO c.s.j.a.c.filter.LoggingFilter - 12 * Server in-bound request
12 > GET http://127.0.0.1:8080/1.0/kb/subscriptions/6e760b12-60fa-4810-9022-742b5e6792ce
12 > host: 127.0.0.1:8080
12 > content-type: application/json; charset=utf-8
12 > x-killbill-createdby: ccb
12 > x-killbill-reason: userrequest
12 > x-killbill-comment: client impletentation
12 > x-killbill-apikey: bob
12 > x-killbill-apisecret: lazar
12 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
12 > connection: keep-alive
12 > accept: */*
12 > user-agent: NING/1.0
12 >
12:51:06.001 [http-bio-8080-exec-3] INFO c.s.j.a.c.filter.LoggingFilter - 12 * Server out-bound response
12 < 200
12 < Content-Type: application/json
12 <
I was testing the subscription flow and I am bit confused with the invoice events.
Running multiple times the same request flow i found invoice event are not getting processed every time. I am using kill-bill 1.6.17 version.
<effectiveDate>2013-10-01T00:00:00+00:00</effectiveDate>
<catalogName>aclcatalog</catalogName>
<currencies>
<currency>USD</currency>
<currency>INR</currency>
<currency>GBP</currency>
</currencies>
<units>
<unit name="shells"/>
</units>
<products>
<product name="frenzo-usage">
<category>BASE</category>
<included>
<addonProduct>gift</addonProduct>
</included>
<available>
<addonProduct>extra-gift</addonProduct>
</available>
</product>
<product name="frenzo-mini">
<category>BASE</category>
<limits>
<limit>
<unit>shells</unit>
<max>5</max>
</limit>
</limits>
</product>
<product name="gift">
<category>ADD_ON</category>
</product>
<product name="extra-gift">
<category>ADD_ON</category>
</product>
</products>
<rules>
<changePolicy>
<changePolicyCase>
<fromBillingPeriod>MONTHLY</fromBillingPeriod>
<toProduct>frenzo-mini</toProduct>
<toBillingPeriod>MONTHLY</toBillingPeriod>
<policy>END_OF_TERM</policy>
</changePolicyCase>
<changePolicyCase>
<phaseType>EVERGREEN</phaseType>
<policy>IMMEDIATE</policy>
</changePolicyCase>
</changePolicy>
<changeAlignment>
<changeAlignmentCase>
<alignment>START_OF_SUBSCRIPTION</alignment>
</changeAlignmentCase>
</changeAlignment>
<createAlignment>
<createAlignmentCase>
<product>gift</product>
<alignment>START_OF_SUBSCRIPTION</alignment>
</createAlignmentCase>
<createAlignmentCase>
<alignment>START_OF_SUBSCRIPTION</alignment>
</createAlignmentCase>
</createAlignment>
<billingAlignment>
<billingAlignmentCase>
<alignment>ACCOUNT</alignment>
</billingAlignmentCase>
</billingAlignment>
<priceList>
<priceListCase>
<toPriceList>DEFAULT</toPriceList>
</priceListCase>
</priceList>
</rules>
<plans>
<plan name="frenzo-usage-monthly">
<product>frenzo-usage</product>
<!--<initialPhases>
<phase type="TRIAL">
<duration>
<unit>DAYS</unit>
<number>1</number>
</duration>
<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
<fixedPrice>
</fixedPrice>
</phase>
</initialPhases>-->
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
</duration>
<billingPeriod>MONTHLY</billingPeriod>
<recurringPrice>
<price><currency>GBP</currency><value>29.95</value></price>
<price><currency>INR</currency><value>5</value></price>
<price><currency>USD</currency><value>29.95</value></price>
</recurringPrice>
<!-- <limits>
<limit>
<unit>targets</unit>
<min>3</min>
</limit>
<limit>
<unit>misfires</unit>
<max>20</max>
</limit>
</limits>-->
</finalPhase>
</plan>
<plan name="frenzo-mini-monthly">
<product>frenzo-mini</product>
<!--<initialPhases>
<phase type="TRIAL">
<duration>
<unit>DAYS</unit>
<number>30</number>
</duration>
<billingPeriod>NO_BILLING_PERIOD</billingPeriod>
<fixedPrice></fixedPrice>
</phase>
</initialPhases>-->
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
<number>-1</number>
</duration>
<billingPeriod>MONTHLY</billingPeriod>
<recurringPrice>
<price><currency>USD</currency><value>249.95</value></price>
<price><currency>INR</currency><value>1</value></price>
<price><currency>GBP</currency><value>169.95</value></price>
</recurringPrice>
</finalPhase>
</plan>
<plan name="gift-monthly">
<product>gift</product>
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
</duration>
<billingPeriod>MONTHLY</billingPeriod>
<recurringPrice>
<price><currency>USD</currency><value>1999.95</value></price>
<price><currency>INR</currency><value>2</value></price>
<price><currency>GBP</currency><value>1999.95</value></price>
</recurringPrice>
</finalPhase>
</plan>
<plan name="extra-gift-monthly">
<product>extra-gift</product>
<finalPhase type="EVERGREEN">
<duration>
<unit>UNLIMITED</unit>
</duration>
<billingPeriod>MONTHLY</billingPeriod>
<recurringPrice>
<price><currency>USD</currency><value>1999.95</value></price>
<price><currency>INR</currency><value>5</value></price>
<price><currency>GBP</currency><value>1999.95</value></price>
</recurringPrice>
</finalPhase>
</plan>
</plans>
<priceLists>
<defaultPriceList name="DEFAULT">
<plans>
<plan>frenzo-usage-monthly</plan>
<plan>frenzo-mini-monthly</plan>
</plans>
</defaultPriceList>
</priceLists>
</catalog>
@Test(groups = "slow")
public void testCreateAndsubscribe() throws Exception {
final KillBillAccount account = new KillBillAccount();
account.setName(UUID.randomUUID().toString());
account.setExternalKey(UUID.randomUUID().toString());
account.setEmail(UUID.randomUUID().toString());
account.setCurrency("INR");
final KillBillAccount retrievedAccount = account.createAccount();
final AccountJson retrievedAccountJson = retrievedAccount.doCreateAccountWithDefaultPaymentMethod(retrievedAccount.toAccountJson());
Assert.assertNotNull(retrievedAccountJson.getPaymentMethodId());
Thread.sleep(1000);
retrievedAccount.setPaymentMethodId(retrievedAccountJson.getPaymentMethodId());
KillBillSubscription killBillSubscription = new KillBillSubscription();
SubscriptionJson json=killBillSubscription.createSubscription(null, "frenzo-usage", "BASE", "MONTHLY", false,retrievedAccount.getAccountId(),UUID.randomUUID().toString(),PriceListSet.DEFAULT_PRICELIST_NAME);
Assert.assertEquals(json.getAccountId(),retrievedAccount.getAccountId());
System.out.println(json.getAccountId()+"::"+json.getSubscriptionId());
}
I have also noticed this invoice event not triggering when I tested with the curl request in the doc and posted my first query in this group. I mentioned the trying again with different plan triggered the invoice.
regards,
Nitin
I am upgrading my kill bill code from 0.6.7 to 0.8.1. After that I'll rerun the code and will post my findings.
The issue I have posted was some times invoice dispatcher is generating invoice and some times not. I just watching the logs which I have posted. Today I have found that invoice dispatcher is generating invoice but invoice handler is not called each time to initiate payment. I'll investigate more today with the new code base and will post my findings.
One more thing I want to understand if my approach is correct for the billing system. I want to trigger payment for any subscription and if payment is successful mark them subscribed. I have tested the billing event by the changing the billing date and it works. I am not sure about the payment status and subscription given at the time of creation. Can I make subscription creation and payment synchronously or on the basis of payment create subscription.
Regards,
Nitin
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/fe6a80c7-e99f-4a26-91f1-30109bb66fc8%40googlegroups.com.
Third iteration again successful
12:24:30.478 [bus-th] INFO c.n.b.invoice.InvoiceDispatcher - Generated invoice ae3b8153-3a8a-40af-9fa5-2ea037e16229 with 1 items for accountId 2ffae941-8a18-48b9-845b-58b2e3b76ed2 and targetDate 2013-11-07 (targetDateTime 2013-11-07T06:54:28.000Z)
12:24:30.681 [bus-th] INFO c.n.b.i.n.DefaultNextBillingDatePoster - Queuing next billing date notification at 2013-12-07T06:54:28.000Z for subscriptionId 5cc31f21-3399-4f99-a6c2-586be82f70fb
12:24:30.873 [bus-th] INFO c.n.b.invoice.InvoiceDispatcher - DefaultInvoiceCreationEvent for ae3b8153-3a8a-40af-9fa5-2ea037e16229
12:24:30.873 [bus-th] INFO c.n.b.invoice.InvoiceDispatcher - post InvoiceInternalEvent event
12:24:31.143 [bus-th] INFO c.n.b.payment.bus.InvoiceHandler - Received invoice creation notification for account 2ffae941-8a18-48b9-845b-58b2e3b76ed2 and invoice ae3b8153-3a8a-40af-9fa5-2ea037e16229
DO PAYMENT OF 2ffae941-8a18-48b9-845b-58b2e3b76ed2::183867a7-1897-48f3-8bd4-5a75dbc3eba0::5.00
Therefore I doubt on the bus event processing status. When it is marked processed?
regards,
Nitin
12:26:51.455 [http-apr-8080-exec-2] INFO c.s.j.a.c.filter.LoggingFilter - 25 * Server in-bound request
25 > POST http://127.0.0.1:8080/1.0/kb/accounts
25 > host: 127.0.0.1:8080
25 > content-type: application/json; charset=utf-8
25 > x-killbill-createdby: ccb
25 > x-killbill-reason: userrequest
25 > x-killbill-comment: client impletentation
25 > x-killbill-apikey: bob
25 > x-killbill-apisecret: lazar
25 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
25 > connection: keep-alive
25 > accept: */*
25 > user-agent: NING/1.0
25 > content-length: 505
25 >
12:26:51.617 [http-apr-8080-exec-2] INFO c.s.j.a.c.filter.LoggingFilter - 25 * Server out-bound response
25 < 201
25 < Location: http://127.0.0.1:8080/1.0/kb/accounts/7cd38013-c87a-481e-a83d-b53062c18712
25 < Content-Type: application/json
25 <
12:26:51.910 [http-apr-8080-exec-6] INFO c.s.j.a.c.filter.LoggingFilter - 26 * Server in-bound request
26 > GET http://127.0.0.1:8080/1.0/kb/accounts?externalKey=601bf69b-bc95-4a34-9f0b-820f7fa65a7c
26 > host: 127.0.0.1:8080
26 > content-type: application/json; charset=utf-8
26 > x-killbill-createdby: ccb
26 > x-killbill-reason: userrequest
26 > x-killbill-comment: client impletentation
26 > x-killbill-apikey: bob
26 > x-killbill-apisecret: lazar
26 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
26 > connection: keep-alive
26 > accept: */*
26 > user-agent: NING/1.0
26 >
12:26:51.927 [http-apr-8080-exec-6] INFO c.s.j.a.c.filter.LoggingFilter - 26 * Server out-bound response
26 < 200
26 < Content-Type: application/json
26 <
12:26:52.355 [http-apr-8080-exec-10] INFO c.s.j.a.c.filter.LoggingFilter - 27 * Server in-bound request
27 > POST http://127.0.0.1:8080/1.0/kb/accounts/7cd38013-c87a-481e-a83d-b53062c18712/paymentMethods?isDefault=true
27 > host: 127.0.0.1:8080
27 > content-type: application/json; charset=utf-8
27 > x-killbill-createdby: ccb
27 > x-killbill-reason: userrequest
27 > x-killbill-comment: client impletentation
27 > x-killbill-apikey: bob
27 > x-killbill-apisecret: lazar
27 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
27 > connection: keep-alive
27 > accept: */*
27 > user-agent: NING/1.0
27 > content-length: 391
27 >
12:26:52.626 [http-apr-8080-exec-10] INFO c.s.j.a.c.filter.LoggingFilter - 27 * Server out-bound response
27 < 201
27 < Location: http://127.0.0.1:8080/1.0/kb/paymentMethods/081f3961-225e-45c1-86bc-e32faddeeb07
27 < Content-Type: application/json
27 <
12:26:52.914 [http-apr-8080-exec-4] INFO c.s.j.a.c.filter.LoggingFilter - 28 * Server in-bound request
28 > GET http://127.0.0.1:8080/1.0/kb/accounts?externalKey=601bf69b-bc95-4a34-9f0b-820f7fa65a7c
28 > host: 127.0.0.1:8080
28 > content-type: application/json; charset=utf-8
28 > x-killbill-createdby: ccb
28 > x-killbill-reason: userrequest
28 > x-killbill-comment: client impletentation
28 > x-killbill-apikey: bob
28 > x-killbill-apisecret: lazar
28 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
28 > connection: keep-alive
28 > accept: */*
28 > user-agent: NING/1.0
28 >
12:26:52.931 [http-apr-8080-exec-4] INFO c.s.j.a.c.filter.LoggingFilter - 28 * Server out-bound response
28 < 200
28 < Content-Type: application/json
28 <
12:26:54.267 [http-apr-8080-exec-8] INFO c.s.j.a.c.filter.LoggingFilter - 29 * Server in-bound request
29 > POST http://127.0.0.1:8080/1.0/kb/subscriptions
29 > host: 127.0.0.1:8080
29 > content-type: application/json; charset=utf-8
29 > x-killbill-createdby: ccb
29 > x-killbill-reason: userrequest
29 > x-killbill-comment: client impletentation
29 > x-killbill-apikey: bob
29 > x-killbill-apisecret: lazar
29 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
29 > connection: keep-alive
29 > accept: */*
29 > user-agent: NING/1.0
29 > content-length: 424
29 >
12:26:54.615 [http-apr-8080-exec-8] INFO c.s.j.a.c.filter.LoggingFilter - 29 * Server out-bound response
29 < 201
29 < Location: http://127.0.0.1:8080/1.0/kb/subscriptions/4a36af40-8095-4951-8822-9d8190a895fd
29 < Content-Type: application/json
29 <
12:26:54.898 [http-apr-8080-exec-2] INFO c.s.j.a.c.filter.LoggingFilter - 30 * Server in-bound request
30 > GET http://127.0.0.1:8080/1.0/kb/subscriptions/4a36af40-8095-4951-8822-9d8190a895fd
30 > host: 127.0.0.1:8080
30 > content-type: application/json; charset=utf-8
30 > x-killbill-createdby: ccb
30 > x-killbill-reason: userrequest
30 > x-killbill-comment: client impletentation
30 > x-killbill-apikey: bob
30 > x-killbill-apisecret: lazar
30 > authorization: Basic YWRtaW46cGFzc3dvcmQ=
30 > connection: keep-alive
30 > accept: */*
30 > user-agent: NING/1.0
30 >
12:26:55.125 [http-apr-8080-exec-2] INFO c.s.j.a.c.filter.LoggingFilter - 30 * Server out-bound response
30 < 200
30 < Content-Type: application/json
30 <
Fourth iteration shows no invoice logs bus_event_history table shows only account creation, change, DefaultEffectiveSubscriptionEvent and DefaultRequestedSubscriptionEvent all marked processed. There is no invoice event in the table like in previous iterations. There are No exceptions
Debugging more in guava I have found that some times
DefaultEffectiveSubscriptionEvent is marked as dead event
18:30:25.264 [bus-th] INFO c.g.c.e.EventBus.Killbill EventBus - dead event class com.ning.billing.subscription.api.user.DefaultEffectiveSubscriptionEvent
Therefore no invoice is generated in this case.
when event is called
18:26:48.008 [bus-th] INFO c.g.c.e.EventBus.Killbill EventBus - dispatch called class com.ning.billing.subscription.api.user.DefaultEffectiveSubscriptionEvent
18:26:48.008 [bus-th] INFO c.n.billing.invoice.InvoiceListener - EffectiveSubscriptionInternalEvent CREATE remaining events::0
strange thing is dead event is marked when wrapper is empty in
Set<EventHandler> wrappers = handlersByType.get(eventType);
And first time I am getting a non empty wrapper resulting successful event dispatch but after that in the very next iteration wrapper is empty for the same event. I hope it's not some cache issue
Please suggest
regards,
Nitin
logger.info("dead event "+event.getClass());
post(new DeadEvent(this, event));
}
and log in com.google.common.eventbus.EventBus.dispatch
try {
logger.info("dispatch called "+event.getClass());
Debugging more in guava I have found that some timesDefaultEffectiveSubscriptionEvent is marked as dead event
18:30:25.264 [bus-th] INFO c.g.c.e.EventBus.Killbill EventBus - dead event class com.ning.billing.subscription.api.user.DefaultEffectiveSubscriptionEvent
Therefore no invoice is generated in this case.
when event is called
18:26:48.008 [bus-th] INFO c.g.c.e.EventBus.Killbill EventBus - dispatch called class com.ning.billing.subscription.api.user.DefaultEffectiveSubscriptionEvent
18:26:48.008 [bus-th] INFO c.n.billing.invoice.InvoiceListener - EffectiveSubscriptionInternalEvent CREATE remaining events::0
strange thing is dead event is marked when wrapper is empty in
Set<EventHandler> wrappers = handlersByType.get(eventType);
And first time I am getting a non empty wrapper resulting successful event dispatch but after that in the very next iteration wrapper is empty for the same event.
I have noticed that EventBus.handlersByType object is changing its state at runtime which causes the problem.
key set in this map
11:24:36.273 [bus-th] INFO c.g.c.e.EventBus.Killbill EventBus - ----[interface com.ning.billing.events.BusInternalEvent, interface com.ning.billing.events.ControlTagDeletionInternalEvent, interface com.ning.billing.events.RepairSubscriptionInternalEvent, interface com.ning.billing.events.EffectiveEntitlementInternalEvent, interface com.ning.billing.events.PaymentInfoInternalEvent, interface com.ning.billing.events.InvoiceAdjustmentInternalEvent, interface com.ning.billing.events.EffectiveSubscriptionInternalEvent, interface com.ning.billing.events.BlockingTransitionInternalEvent, interface com.ning.billing.events.ControlTagCreationInternalEvent, interface com.ning.billing.events.PaymentErrorInternalEvent, interface com.ning.billing.events.InvoiceCreationInternalEvent]
changes to
11:24:37.563 [bus-th] INFO c.g.c.e.EventBus.Killbill EventBus - ----[interface com.ning.billing.notification.plugin.api.ExtBusEvent]
and after which events are turning to dead events.
regards,
Nitin
I have found that there are muliplte instance of DefaultPersistnaceBus are created by the system the bus provider has
@Override
public PersistentBus get() {
return new DefaultPersistentBus(dbi, clock, busConfig, metricRegistry);
}
Which creates a new instance When get is called and all the events are forwarded to this new bus. Now this bus doesnot contain the old subscribers so all the events start turning to dead event.
13:17:58.963 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - class com.ning.billing.account.api.user.DefaultAccountChangeEvent doProcessEvents com.ning.billing.account.api.user.DefaultAccountChangeEvent@14cfd968
13:17:58.963 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383896839804 - hashcode 1529586214----[interface com.ning.billing.events.ControlTagDeletionInternalEvent, interface com.ning.billing.events.RepairSubscriptionInternalEvent, interface com.ning.billing.events.EffectiveSubscriptionInternalEvent, interface com.ning.billing.events.ControlTagCreationInternalEvent, interface com.ning.billing.events.BusInternalEvent, interface com.ning.billing.events.PaymentErrorInternalEvent, interface com.ning.billing.events.EffectiveEntitlementInternalEvent, interface com.ning.billing.events.BlockingTransitionInternalEvent, interface com.ning.billing.events.InvoiceAdjustmentInternalEvent, interface com.ning.billing.events.PaymentInfoInternalEvent, interface com.ning.billing.events.InvoiceCreationInternalEvent]
13:17:58.963 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383896839804 - dispatch called class com.ning.billing.account.api.user.DefaultAccountChangeEvent
13:17:58.963 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383896839804 - dispatch called class com.ning.billing.account.api.user.DefaultAccountChangeEvent
13:17:58.963 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - class com.ning.billing.invoice.api.user.DefaultInvoiceCreationEvent doProcessEvents DefaultInvoiceCreationNotification [invoiceId=98d2c41f-6af1-46b0-ab53-bc7e00523558, accountId=3b3da81b-cabe-4876-a3a5-69e3f8a79865, amountOwed=5.00, currency=INR]
13:17:58.964 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383896840830 - hashcode 209728876----[interface com.ning.billing.notification.plugin.api.ExtBusEvent]
13:17:58.964 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383896840830 - dead event class com.ning.billing.invoice.api.user.DefaultInvoiceCreationEvent
13:17:58.964 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383896840830 - hashcode 209728876----[interface com.ning.billing.notification.plugin.api.ExtBusEvent]
13:17:58.985 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent doProcessEvents DefaultBusExternalEvent{objectId=a752702d-d019-4df8-9ede-553be347afda, accountId=3b3da81b-cabe-4876-a3a5-69e3f8a79865, tenantId=d2c06716-8d4d-41eb-889f-66344046bb80, objectType=SUBSCRIPTION, eventType=SUBSCRIPTION_CREATION}
13:17:58.985 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383896840830 - hashcode 209728876----[interface com.ning.billing.notification.plugin.api.ExtBusEvent]
13:17:58.985 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383896840830 - dispatch called class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent
13:17:58.986 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383896840830 - dispatch called class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent
13:17:59.081 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - 8f683d70-e91c-4a2d-9f0e-f20481bc2518 post event class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent
Please suggest if I have some configuration issue.
regards,
Nitin
14:16:25.316 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - class com.ning.billing.account.api.user.DefaultAccountChangeEvent doProcessEvents com.ning.billing.account.api.user.DefaultAccountChangeEvent@aab60a26
14:16:25.316 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899918044 - hashcode 486328863----[interface com.ning.billing.notification.plugin.api.ExtBusEvent]
14:16:25.316 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899918044 - dead event class com.ning.billing.account.api.user.DefaultAccountChangeEvent
14:16:25.316 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899918044 - hashcode 486328863----[interface com.ning.billing.notification.plugin.api.ExtBusEvent]
14:16:25.532 [bus-th] INFO c.n.b.i.n.DefaultNextBillingDatePoster - Queuing next billing date notification at 2013-12-08T08:46:23.000Z for subscriptionId 8f7ac480-af95-4dee-8c6c-ea01ae36b205
14:16:25.827 [bus-th] INFO c.n.b.invoice.InvoiceDispatcher - DefaultInvoiceCreationEvent for 3898f5f4-5886-4cbe-a07f-efc08a776c4c
14:16:25.827 [bus-th] INFO c.n.b.invoice.InvoiceDispatcher - post InvoiceInternalEvent event
14:16:25.833 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - 3707127a-afd1-4a16-b698-49d75d5c8476 post event class com.ning.billing.invoice.api.user.DefaultInvoiceCreationEvent
14:16:25.892 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - dispatch called class com.ning.billing.subscription.api.user.DefaultEffectiveSubscriptionEvent
14:16:25.925 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - 3707127a-afd1-4a16-b698-49d75d5c8476 post event class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent
14:16:25.925 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - dispatch called class com.ning.billing.subscription.api.user.DefaultEffectiveSubscriptionEvent
14:16:25.936 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - class com.ning.billing.subscription.api.user.DefaultRequestedSubscriptionEvent doProcessEvents DefaultRequestedSubscriptionEvent{bundleId=6c6c0ed8-e8fe-4adb-b9bd-be7d2c5bce14, totalOrdering=0, subscriptionId=8f7ac480-af95-4dee-8c6c-ea01ae36b205, eventId=561ace25-82be-47e3-ab60-a1a22171f213, requestedTransitionTime=2013-11-08T08:46:23.000Z, effectiveTransitionTime=2013-11-08T08:46:23.000Z, previousState=null, previousPriceList='null', previousPlan='null', previousPhase='null', nextState=null, nextPriceList='null', nextPlan='null', nextPhase='null', remainingEventsForUserOperation=0, transitionType=null, startDate=null}
14:16:25.937 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - hashcode 1940820101----[interface com.ning.billing.events.EffectiveEntitlementInternalEvent, interface com.ning.billing.events.BusInternalEvent, interface com.ning.billing.events.RepairSubscriptionInternalEvent, interface com.ning.billing.events.EffectiveSubscriptionInternalEvent, interface com.ning.billing.events.ControlTagCreationInternalEvent, interface com.ning.billing.events.InvoiceAdjustmentInternalEvent, interface com.ning.billing.events.ControlTagDeletionInternalEvent, interface com.ning.billing.events.PaymentErrorInternalEvent, interface com.ning.billing.events.PaymentInfoInternalEvent, interface com.ning.billing.events.InvoiceCreationInternalEvent, interface com.ning.billing.events.BlockingTransitionInternalEvent]
14:16:25.937 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - dispatch called class com.ning.billing.subscription.api.user.DefaultRequestedSubscriptionEvent
14:16:25.959 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - dispatch called class com.ning.billing.subscription.api.user.DefaultRequestedSubscriptionEvent
14:16:26.509 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - events.size() 2
14:16:26.509 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - class com.ning.billing.invoice.api.user.DefaultInvoiceCreationEvent doProcessEvents DefaultInvoiceCreationNotification [invoiceId=3898f5f4-5886-4cbe-a07f-efc08a776c4c, accountId=1c2fde12-4246-4984-a37c-46dea8446d65, amountOwed=5.00, currency=INR]
14:16:26.510 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - hashcode 1940820101----[interface com.ning.billing.events.EffectiveEntitlementInternalEvent, interface com.ning.billing.events.BusInternalEvent, interface com.ning.billing.events.RepairSubscriptionInternalEvent, interface com.ning.billing.events.EffectiveSubscriptionInternalEvent, interface com.ning.billing.events.ControlTagCreationInternalEvent, interface com.ning.billing.events.InvoiceAdjustmentInternalEvent, interface com.ning.billing.events.ControlTagDeletionInternalEvent, interface com.ning.billing.events.PaymentErrorInternalEvent, interface com.ning.billing.events.PaymentInfoInternalEvent, interface com.ning.billing.events.InvoiceCreationInternalEvent, interface com.ning.billing.events.BlockingTransitionInternalEvent]
14:16:26.510 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - dispatch called class com.ning.billing.invoice.api.user.DefaultInvoiceCreationEvent
14:16:26.512 [bus-th] INFO c.n.b.payment.bus.InvoiceHandler - Received invoice creation notification for account 1c2fde12-4246-4984-a37c-46dea8446d65 and invoice 3898f5f4-5886-4cbe-a07f-efc08a776c4c
14:16:27.456 [Plugin-th-87] INFO c.n.billing.bus.DefaultPersistentBus - 3707127a-afd1-4a16-b698-49d75d5c8476 post event class com.ning.billing.payment.api.DefaultPaymentInfoEvent
14:16:27.457 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - dispatch called class com.ning.billing.invoice.api.user.DefaultInvoiceCreationEvent
14:16:27.487 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - 3707127a-afd1-4a16-b698-49d75d5c8476 post event class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent
14:16:27.487 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - dispatch called class com.ning.billing.invoice.api.user.DefaultInvoiceCreationEvent
14:16:27.498 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent doProcessEvents DefaultBusExternalEvent{objectId=8f7ac480-af95-4dee-8c6c-ea01ae36b205, accountId=1c2fde12-4246-4984-a37c-46dea8446d65, tenantId=d2c06716-8d4d-41eb-889f-66344046bb80, objectType=SUBSCRIPTION, eventType=SUBSCRIPTION_CREATION}
14:16:27.498 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - hashcode 1940820101----[interface com.ning.billing.events.EffectiveEntitlementInternalEvent, interface com.ning.billing.events.BusInternalEvent, interface com.ning.billing.events.RepairSubscriptionInternalEvent, interface com.ning.billing.events.EffectiveSubscriptionInternalEvent, interface com.ning.billing.events.ControlTagCreationInternalEvent, interface com.ning.billing.events.InvoiceAdjustmentInternalEvent, interface com.ning.billing.events.ControlTagDeletionInternalEvent, interface com.ning.billing.events.PaymentErrorInternalEvent, interface com.ning.billing.events.PaymentInfoInternalEvent, interface com.ning.billing.events.InvoiceCreationInternalEvent, interface com.ning.billing.events.BlockingTransitionInternalEvent]
14:16:27.498 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - dead event class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent
14:16:27.499 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899893059 - hashcode 1940820101----[interface com.ning.billing.events.EffectiveEntitlementInternalEvent, interface com.ning.billing.events.BusInternalEvent, interface com.ning.billing.events.RepairSubscriptionInternalEvent, interface com.ning.billing.events.EffectiveSubscriptionInternalEvent, interface com.ning.billing.events.ControlTagCreationInternalEvent, interface com.ning.billing.events.InvoiceAdjustmentInternalEvent, interface com.ning.billing.events.ControlTagDeletionInternalEvent, interface com.ning.billing.events.PaymentErrorInternalEvent, interface com.ning.billing.events.PaymentInfoInternalEvent, interface com.ning.billing.events.InvoiceCreationInternalEvent, interface com.ning.billing.events.BlockingTransitionInternalEvent]
14:16:28.333 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - events.size() 2
14:16:28.334 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - class com.ning.billing.payment.api.DefaultPaymentInfoEvent doProcessEvents DefaultPaymentInfoEvent{accountId=1c2fde12-4246-4984-a37c-46dea8446d65, invoiceId=3898f5f4-5886-4cbe-a07f-efc08a776c4c, paymentId=783839f8-cc51-4359-8a97-3d2ece2c2992, amount=5.0000, paymentNumber=25, status=SUCCESS, effectiveDate=2013-11-08T08:46:26.000Z}
14:16:28.335 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899918044 - hashcode 486328863----[interface com.ning.billing.notification.plugin.api.ExtBusEvent]
14:16:28.335 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899918044 - dead event class com.ning.billing.payment.api.DefaultPaymentInfoEvent
14:16:28.335 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899918044 - hashcode 486328863----[interface com.ning.billing.notification.plugin.api.ExtBusEvent]
14:16:28.346 [bus-th] INFO c.n.billing.bus.DefaultPersistentBus - class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent doProcessEvents DefaultBusExternalEvent{objectId=3898f5f4-5886-4cbe-a07f-efc08a776c4c, accountId=1c2fde12-4246-4984-a37c-46dea8446d65, tenantId=d2c06716-8d4d-41eb-889f-66344046bb80, objectType=INVOICE, eventType=INVOICE_CREATION}
14:16:28.346 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899918044 - hashcode 486328863----[interface com.ning.billing.notification.plugin.api.ExtBusEvent]
14:16:28.346 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899918044 - dispatch called class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent
14:16:28.372 [bus-th] INFO c.g.c.e.E.Killbill-EventBus1383899918044 - dispatch called class com.ning.billing.beatrix.extbus.DefaultBusExternalEvent
has solved the issue for me.
It seems both persistence bus were using the default table but were not able to processes them.
I don't get the instance name "external" but from the test resource I found it. Please let me know if its correct.
thanks,
Nitin
putting
-Dkillbill.billing.persistent.bus.external.tableName=bus_ext_events -Dkillbill.billing.persistent.bus.external.historyTableName=bus_ext_events_history
has solved the issue for me.
It seems both persistence bus were using the default table but were not able to processes them.
I don't get the instance name "external" but from the test resource I found it. Please let me know if its correct.
As per my understanding bus event has a map of events mapped to it and there handlers. So main bus event don't recognize external event and vice versa. Since both persistence bus pick from same table, the unrecognized events could be picked and end up dead event. That's why different set of table or some way to recognize bus required.