killbill/killbill-commons

New Queue API

pierre opened this issue · 1 comments

Change PersistentBus to get rid of Transmogrifier:

public void postFromTransaction(BusEvent event, final Transmogrifier transmogrifier) throws EventBusException;

becomes

public void postFromTransaction(BusEvent event, final Connection connection) throws EventBusException;

where connection is a generic java.sql.Connection (autoCommit is false).

Changes in killbill-commons:

  • Fix implementation in DefaultPersistentBus
  • Create a DataSource to return that Connection
  • Create a DBI from this DataSource
  • Call onDemand

Changes in killbill:

  • Implement new TransactionHandler (KillBillTransactionHandler)
  • Have KillBillTransactionHandler delegate to RestartTransactionRunner (configurable)
  • Intercept the transaction and cache the Handle in a thread local
  • EntitySqlDaoTransactionalJdbiWrapper can now get the TransactionHandler from the DBI and pass the Connection in EntitySqlDaoTransactionWrapper#inTransaction (signature change)

As part of this work, we should

  • check with upstream if they can expose the Handle/Connection in the transaction directly
  • upgrade JDBI to the latest version

The changes in Kill Bill were actually simpler. See killbill/killbill@66576bf and killbill/killbill@0796d02.