wtorek, września 30, 2014

Transactional MDB on JBoss 5: look inside

10:36:49,975 (Connection consumer 120) BaseTransaction.begin
10:36:49,975 (Connection consumer 120) StateManager::StateManager( 2 )
10:36:49,971 (Connection consumer 115) [com.arjuna.ats.arjuna.coordinator.BasicAction_7] - BasicAction::addChildThread () action -3f57c7ff:eafe:542a6b9a:a2 adding Thread[Connection consumer 115,5,JBoss Pooled Threads] result = true
10:36:49,975 (Connection consumer 120) BasicAction::BasicAction()
10:36:49,976 (Connection consumer 120) BasicAction::Begin() for action-id -3f57c7ff:eafe:542a6b9a:ab
10:36:49,976 (Connection consumer 120) BasicAction::actionInitialise() for action-id -3f57c7ff:eafe:542a6b9a:ab
10:36:49,976 (Connection consumer 120) ActionHierarchy::ActionHierarchy(5)
10:36:49,976 (Connection consumer 120) ActionHierarchy::add(-3f57c7ff:eafe:542a6b9a:ab, 1)
10:36:49,976 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_6] - BasicAction::addChildThread () action -3f57c7ff:eafe:542a6b9a:ab adding Thread[Connection consumer 120,5,JBoss Pooled Threads]
10:36:49,976 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_7] - BasicAction::addChildThread () action -3f57c7ff:eafe:542a6b9a:ab adding Thread[Connection consumer 120,5,JBoss Pooled Threads] result = true
10:36:49,979 (Connection consumer 120) TransactionReaper::create ( 120000 )
10:36:49,979 (Connection consumer 120) TransactionReaper::insert ( BasicAction: -3f57c7ff:eafe:542a6b9a:ab status: ActionStatus.RUNNING, 300 )
10:36:49,979 (Connection consumer 120) ReaperElement::ReaperElement ( BasicAction: -3f57c7ff:eafe:542a6b9a:ab status: ActionStatus.RUNNING, 300 )
10:36:49,979 [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy] (Connection consumer 120) MessageEndpoint TestQueue started transaction=TransactionImple < ac, BasicAction: -3f57c7ff:eafe:542a6b9a:ab status: ActionStatus.RUNNING >
10:36:49,979 (Connection consumer 120) TransactionImple.enlistResource ( com.tibco.tibjms.XResource@4f9ee648 )
10:36:49,979 (Connection consumer 120) TransactionImple.getStatus
10:36:49,980 (Connection consumer 115) TransactionReaper::create ( 120000 )
10:36:49,980 (Connection consumer 120) StateManager::StateManager( 1 )
10:36:49,980 (Connection consumer 120) AbstractRecord::AbstractRecord (-3f57c7ff:eafe:542a6b9a:ad, 1)
10:36:49,971 (Thread-15) ReaperThread.run ()
10:36:49,980 (Connection consumer 120) XAResourceRecord.XAResourceRecord ( < 131075, 28, 26, 494545511025355995510210258101971021015853525097549857975897984551102535599551021025810197102101585352509754985797589799 > )
10:36:49,980 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.RecordList_5] - RecordList::insert(RecordList: empty) : appending /StateManager/AbstractRecord/XAResourceRecord for -3f57c7ff:eafe:542a6b9a:ad
10:36:49,980 [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy] (Connection consumer 120) MessageEndpoint TestQueue enlisted=com.tibco.tibjms.XResource@4f9ee648
10:36:49,980 [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy] (Connection consumer 120) MessageEndpoint TestQueue in use by public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message) Thread[Connection consumer 120,5,JBoss Pooled Threads]
10:36:49,980 [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy] (Connection consumer 120) MessageEndpoint TestQueue delivering
10:36:51,262 [org.jboss.ejb3.pool.StrictMaxPool] (Connection consumer 120) Acquired(true) strictMaxSize semaphore, remaining=0

10:36:51,262 INFO  [STDOUT] (Connection consumer 120) Received text: 2014-09-30T10:35:10.304+02:00 on test.fw1, id=ID:EMS-SERVER-DC2.2354542947B3299:101

10:36:52,330 (Connection consumer 120) TransactionImple.registerSynchronization
10:36:52,331 (Connection consumer 120) TransactionImple.enlistResource ( org.jboss.resource.adapter.jdbc.xa.XAManagedConnection@5c675382 )
10:36:52,331 (Connection consumer 120) TransactionImple.getStatus
10:36:52,331 (Connection consumer 120) AbstractRecord::AbstractRecord (-3f57c7ff:eafe:542a6b9a:1d1, 1)
10:36:52,331 (Connection consumer 120) XAResourceRecord.XAResourceRecord ( < 131075, 28, 27, 494545511025355995510210258101971021015853525097549857975897984551102535599551021025810197102101585352509754985797584910048 > )
10:36:52,333 (Connection consumer 120) TransactionImple.enlistResource ( org.jboss.resource.adapter.jms.JmsXAResource@21f7e1c6 )
10:36:52,333 (Connection consumer 120) TransactionImple.getStatus
10:36:52,333 (Connection consumer 120) StateManager::StateManager( 1 )
10:36:52,333 (Connection consumer 120) AbstractRecord::AbstractRecord (-3f57c7ff:eafe:542a6b9a:1d7, 1)
10:36:52,333 (Connection consumer 120) XAResourceRecord.XAResourceRecord ( < 131075, 28, 27, 494545511025355995510210258101971021015853525097549857975897984551102535599551021025810197102101585352509754985797584910054 > )
10:36:52,360 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.RecordList_5] - RecordList::insert(RecordList: -3f57c7ff:eafe:542a6b9a:ad -3f57c7ff:eafe:542a6b9a:1d1) : appending /StateManager/AbstractRecord/XAResourceRecord for -3f57c7ff:eafe:542a6b9a:1d7
10:36:52,361 (Connection consumer 120) TransactionImple.getStatus
10:36:52,361 (Connection consumer 120) TransactionImple.getStatus
10:36:52,392 [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy] (Connection consumer 120) Invocation took 2412ms: public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message)
10:36:52,392 [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy] (Connection consumer 120) MessageEndpoint TestQueue in use by public abstract void javax.resource.spi.endpoint.MessageEndpoint.afterDelivery() throws javax.resource.ResourceException Thread[Connection consumer 120,5,JBoss Pooled Threads]
10:36:52,392 (Connection consumer 120) TransactionImple.equals
10:36:52,392 (Connection consumer 120) TransactionImple.getStatus
10:36:52,392 [org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy] (Connection consumer 120) MessageEndpoint TestQueue commit
10:36:52,392 (Connection consumer 120) BaseTransaction.commit
10:36:52,392 (Connection consumer 120) TransactionImple.commitAndDisassociate
10:36:52,392 (Connection consumer 120) SynchronizationImple.beforeCompletion

10:36:52,392 (Connection consumer 120) BasicAction::End() for action-id -3f57c7ff:eafe:542a6b9a:ab
10:36:52,392 (Connection consumer 120) BasicAction::prepare () for action-id -3f57c7ff:eafe:542a6b9a:ab
10:36:52,392 (Connection consumer 120) ShadowingStore.ShadowingStore( 14 )
10:36:52,392 (Connection consumer 120) ShadowNoFileLockStore.ShadowNoFileLockStore( 14 )
10:36:52,392 (Connection consumer 120) HashedStore.HashedStore( 14 )
10:36:52,392 (Connection consumer 120) HashedStore.HashedActionStore()
10:36:52,392 (Connection consumer 120) FileSystemStore.setupStore()
10:36:52,392 (Connection consumer 120) FileSystemStore.createHierarchy(C:\_dev\jboss-5.1.0.GA\server\default\data/tx-object-store\HashedActionStore\defaultStore\)
10:36:52,393 (Connection consumer 120) XAResourceRecord.topLevelPrepare for < 131075, 28, 26, 494545511025355995510210258101971021015853525097549857975897984551102535599551021025810197102101585352509754985797589799 >
10:36:52,430 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.RecordList_5] - RecordList::insert(RecordList: empty) : appending /StateManager/AbstractRecord/XAResourceRecord for -3f57c7ff:eafe:542a6b9a:ad
10:36:52,430 (Connection consumer 120) XAResourceRecord.topLevelPrepare for < 131075, 28, 27, 494545511025355995510210258101971021015853525097549857975897984551102535599551021025810197102101585352509754985797584910048 >
10:36:52,494 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.RecordList_5] - RecordList::insert(RecordList: -3f57c7ff:eafe:542a6b9a:ad) : appending /StateManager/AbstractRecord/XAResourceRecord for -3f57c7ff:eafe:542a6b9a:1d1
10:36:52,494 (Connection consumer 120) XAResourceRecord.topLevelPrepare for < 131075, 28, 27, 494545511025355995510210258101971021015853525097549857975897984551102535599551021025810197102101585352509754985797584910054 >
10:36:52,556 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.RecordList_5] - RecordList::insert(RecordList: -3f57c7ff:eafe:542a6b9a:ad -3f57c7ff:eafe:542a6b9a:1d1) : appending /StateManager/AbstractRecord/XAResourceRecord for -3f57c7ff:eafe:542a6b9a:1d7
10:36:52,557 (Connection consumer 120) OutputObjectState::OutputObjectState(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction)
10:36:52,557 (Connection consumer 120) BasicAction::save_state ()
10:36:52,557 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_14] - BasicAction::save_state - next record to pack is a 171 record (/StateManager/AbstractRecord/XAResourceRecord) should save it? = true
10:36:52,557 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_15] - Packing a 171 record
10:36:52,557 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_14] - BasicAction::save_state - next record to pack is a 171 record (/StateManager/AbstractRecord/XAResourceRecord) should save it? = true
10:36:52,557 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_15] - Packing a 171 record
10:36:52,557 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_14] - BasicAction::save_state - next record to pack is a 171 record (/StateManager/AbstractRecord/XAResourceRecord) should save it? = true
10:36:52,557 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_15] - Packing a 171 record
10:36:52,557 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_16] - Packing a NONE_RECORD
10:36:52,557 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_19] - Packing action status of ActionStatus.COMMITTING
10:36:52,557 (Connection consumer 120) FileSystemStore.write_committed(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction)
10:36:52,557 (Connection consumer 120) ShadowingStore.write_state(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction, ObjectStore.OS_ORIGINAL)
10:36:52,557 (Connection consumer 120) HashedStore.genPathName(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction, ObjectStore.OS_ORIGINAL)
10:36:52,557 (Connection consumer 120) FileSystemStore.openAndLock(C:\_dev\jboss-5.1.0.GA\server\default\data/tx-object-store\HashedActionStore\defaultStore\StateManager\BasicAction\TwoPhaseCoordinator\AtomicAction\#97#\-3f57c7ff_eafe_542a6b9a_ab, FileLock.F_WRLCK, true)
10:36:52,557 (Connection consumer 120) FileSystemStore.createHierarchy(C:\_dev\jboss-5.1.0.GA\server\default\data/tx-object-store\HashedActionStore\defaultStore\StateManager\BasicAction\TwoPhaseCoordinator\AtomicAction\#97#\-3f57c7ff_eafe_542a6b9a_ab)
10:36:52,647 (Connection consumer 120) FileSystemStore.closeAndUnlock(C:\_dev\jboss-5.1.0.GA\server\default\data\tx-object-store\HashedActionStore\defaultStore\StateManager\BasicAction\TwoPhaseCoordinator\AtomicAction\#97#\-3f57c7ff_eafe_542a6b9a_ab, null, java.io.FileOutputStream@7e1b811b)
10:36:52,651 (Connection consumer 120) BasicAction::phase2Commit() for action-id -3f57c7ff:eafe:542a6b9a:ab
10:36:52,651 (Connection consumer 120) BasicAction::doCommit (com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@4407393d)
10:36:52,651 (Connection consumer 120) XAResourceRecord.topLevelCommit for < 131075, 28, 26, 494545511025355995510210258101971021015853525097549857975897984551102535599551021025810197102101585352509754985797589799 >
10:36:52,734 (Connection consumer 120) BasicAction::doCommit (com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@32955ada)
10:36:52,734 (Connection consumer 120) XAResourceRecord.topLevelCommit for < 131075, 28, 27, 494545511025355995510210258101971021015853525097549857975897984551102535599551021025810197102101585352509754985797584910048 >
10:36:52,911 (Connection consumer 120) BasicAction::doCommit (com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@1cc05dc2)
10:36:52,911 (Connection consumer 120) XAResourceRecord.topLevelCommit for < 131075, 28, 27, 494545511025355995510210258101971021015853525097549857975897984551102535599551021025810197102101585352509754985797584910054 >
10:36:52,947 (Connection consumer 120) BasicAction::updateState() for action-id -3f57c7ff:eafe:542a6b9a:ab
10:36:52,947 (Connection consumer 120) FileSystemStore.remove_committed(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction)
10:36:52,947 (Connection consumer 120) ShadowingStore.remove_state(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction, ObjectStore.OS_ORIGINAL)
10:36:52,947 (Connection consumer 120) HashedStore.genPathName(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction, ObjectStore.OS_SHADOW)
10:36:52,947 (Connection consumer 120) HashedStore.genPathName(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction, ObjectStore.OS_ORIGINAL)
10:36:52,947 (Connection consumer 120) [com.arjuna.ats.internal.arjuna.objectstore.ShadowingStore_22] - ShadowingStore.currentState(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction) - returning ObjectStore.OS_COMMITTED
10:36:52,947 (Connection consumer 120) HashedStore.genPathName(-3f57c7ff:eafe:542a6b9a:ab, /StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction, ObjectStore.OS_ORIGINAL)
10:36:52,947 (Connection consumer 120) FileSystemStore.openAndLock(C:\_dev\jboss-5.1.0.GA\server\default\data/tx-object-store\HashedActionStore\defaultStore\StateManager\BasicAction\TwoPhaseCoordinator\AtomicAction\#97#\-3f57c7ff_eafe_542a6b9a_ab, FileLock.F_WRLCK, false)
10:36:52,948 (Connection consumer 120) FileSystemStore.closeAndUnlock(C:\_dev\jboss-5.1.0.GA\server\default\data\tx-object-store\HashedActionStore\defaultStore\StateManager\BasicAction\TwoPhaseCoordinator\AtomicAction\#97#\-3f57c7ff_eafe_542a6b9a_ab, null, null)
10:36:52,948 (Connection consumer 120) SynchronizationImple.afterCompletion
10:36:52,948 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_8] - BasicAction::removeChildThread () action -3f57c7ff:eafe:542a6b9a:ab removing TSThread:17
10:36:52,948 (Connection consumer 120) [com.arjuna.ats.arjuna.coordinator.BasicAction_9] -  BasicAction::removeChildThread () action -3f57c7ff:eafe:542a6b9a:ab removing TSThread:17 result = true

JBossTS stores

https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/4.3/html/Transactions_Programmers_Guide/ch02s03s02.html

<!-- (default is BasicLockStore) --> <property name="com.arjuna.ats.txoj.lockstore.lockStoreType" value="BasicPersistentLockStore"/>

https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/5/html/Transactions_Development_Guide/ch15.html

<property name="com.arjuna.ats.arjuna.coordinator.actionStore" value="HashedActionStore"/>

czwartek, września 25, 2014

Globalny wynalazek IBM-a

Elektrownia słoneczna.

piątek, września 19, 2014

EMS datastores

EMS handles datastores by using dedicated threads, having heavily utilized queues on separated stores is a wise step to dismiss 'slow clock' warnings.

JBoss 7.4 (RedHat EAP 6.3) and MDB XA

It is possible to setup XA on EAP 6.3, however there is a minor problem with recovery:

14:53:47,756 WARN  [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016037: Could not find new XAResource to use for recovering non-serializable XAResource XAResourceRecord < resource:null, txid:< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac1211d8:-30ef1c07:541c1f35:24dc, node_name=1, branch_uid=0:ffffac1211d8:-30ef1c07:541c1f35:24fa, subordinatenodename=null, eis_name=java:/sun/XAQueueConnectionFactory >, heuristic: TwoPhaseOutcome.FINISH_OK, product: x/X, jndiName: java:/sun/XAQueueConnectionFactory com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@1c554391 >
14:53:47,756 WARN  [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016038: No XAResource to recover < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac1211d8:-30ef1c07:541c1f35:24dc, node_name=1, branch_uid=0:ffffac1211d8:-30ef1c07:541c1f35:24fa, subordinatenodename=null, eis_name=java:/sun/XAQueueConnectionFactory >
14:53:47,800 WARN  [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016037: Could not find new XAResource to use for recovering non-serializable XAResource XAResourceRecord < resource:null, txid:< formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac1211d8:-30ef1c07:541c1f35:2e9a, node_name=1, branch_uid=0:ffffac1211d8:-30ef1c07:541c1f35:2ea6, subordinatenodename=null, eis_name=java:/XAOracleDS >, heuristic: TwoPhaseOutcome.FINISH_OK, product: Oracle/Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production, jndiName: java:/XAOracleDS com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord@2ebed222 >
14:53:47,800 WARN  [com.arjuna.ats.jta] (Periodic Recovery) ARJUNA016038: No XAResource to recover < formatId=131077, gtrid_length=29, bqual_length=36, tx_uid=0:ffffac1211d8:-30ef1c07:541c1f35:2e9a, node_name=1, branch_uid=0:ffffac1211d8:-30ef1c07:541c1f35:2ea6, subordinatenodename=null, eis_name=java:/XAOracleDS >

Transaction log has orphaned entries, which do not exists on remote Resource Managers. We can live with it.

środa, września 10, 2014

Konfiguracja dbstore.properties dla EMS-a

hibernate.cache.use_second_level_cache=false
hibernate.current_session_context_class=thread
hiberate.cache.provider_class=org.hibernate.cache.NoCacheProvider
hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider
hibernate.c3p0.connectionCustomizerClassName=com.tibco.tibems.tibemsd.internal.db.DataStoreConnectionCustomizer

# Hibernate optimization
hibernate.bytecode.use_reflection_optimizer=true
hibernate.jdbc.batch_size=50
hibernate.id.new_generator_mappings=true
javax.persistence.validation.mode=NONE
hibernate.c3p0.forceIgnoreUnresolvedTransactions=false

# Pool config
hibernate.c3p0.acquireIncrement=1
hibernate.c3p0.checkoutTimeout=10000
hibernate.c3p0.maxPoolSize=12
hibernate.c3p0.minPoolSize=4
hibernate.c3p0.numHelperThreads=6
hibernate.c3p0.maxStatementsPerConnection=100
hibernate.c3p0.maxIdleTimeExcessConnections=900
hibernate.c3p0.maxIdleTime=0
hibernate.c3p0.acquireRetryAttempts=20
hibernate.c3p0.acquireRetryDelay=3000
hibernate.c3p0.idleConnectionTestPeriod=0
# use connection.isvalid from JDBC 4.0
#hibernate.c3p0.preferredTestQuery=select 1 from dual
hibernate.c3p0.testConnectionOnCheckin=false
hibernate.c3p0.testConnectionOnCheckout=true
hibernate.generate_statistics=false

hibernate.connection.oracle.jdbc.StreamBufferSize = 8192
# Column size settings for storing messages
org.hibernate.dialect.Oracle10gDialect.small_len = 1024
org.hibernate.dialect.Oracle9iDialect.small_len = 1024

wtorek, września 09, 2014

Jak działa dbstore w EMS-ie

Klasa Javy com.tibco.tibems.tibemsd.internal.db.CallableDataStore jest używana przez kod C++ (poprzez JNI) do trzymania bieżących danych sterujących oraz zapisywania i odczytywania komunikatów. Do zapisywania wszystkich obiektów służy Hibernate:

[2014-09-09 10:48:28,006] DEBUG [tibemsd] (AbstractBatcher.java:424) - insert into EMS_MESSAGES (MESSAGE_SEQNO, TYPE, PRIORITY, DELIVERYMODE, REDELIVERED, DELIVERY_COUNT, DESTINATION, DESTINATION_TYPE, EXPIRATION, TIMESTAMP, DELIVERYTIME, REPLYTO, REPLYTO_TYPE, USERTYPE, MSGID, CORRELATIONID, COMPRESSED, CLIENTFLAGS, ENCODING, ENCODED_PROPERTIES, ENCODED_SUPPRESS_CONSIDS, TXNID, ZONEID, ROUTESRC, ROUTESEQNO, ROUTECONSID, PRODUCERID, DELETED, MESSAGE_SIZE, SMALL_MESSAGE_BODY, LARGE_MESSAGE_BODY, STORE_ID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
[2014-09-09 10:48:28,006] TRACE [tibemsd] (NullableType.java:133) - binding '337' to parameter: 1
[2014-09-09 10:48:28,006] TRACE [tibemsd] (NullableType.java:133) - binding '3' to parameter: 2
[2014-09-09 10:48:28,006] TRACE [tibemsd] (NullableType.java:133) - binding '4' to parameter: 3
[2014-09-09 10:48:28,006] TRACE [tibemsd] (NullableType.java:133) - binding '2' to parameter: 4
[2014-09-09 10:48:28,006] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 5
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 6
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:133) - binding 'test.fw1' to parameter: 7
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:133) - binding '1' to parameter: 8
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 9
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:133) - binding '1410252507549' to parameter: 10
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 11
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:126) - binding null to parameter: 12
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 13
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:126) - binding null to parameter: 14
[2014-09-09 10:48:28,007] TRACE [tibemsd] (NullableType.java:133) - binding 'ID:EMS-SERVER-DC2.23FC540EBDA24:2' to parameter: 15
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:126) - binding null to parameter: 16
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:133) - binding 'false' to parameter: 17
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 18
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:126) - binding null to parameter: 19
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:126) - binding null to parameter: 20
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:126) - binding null to parameter: 21
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 22
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 23
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:126) - binding null to parameter: 24
[2014-09-09 10:48:28,008] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 25
[2014-09-09 10:48:28,009] TRACE [tibemsd] (NullableType.java:133) - binding '0' to parameter: 26
[2014-09-09 10:48:28,009] TRACE [tibemsd] (NullableType.java:133) - binding '1' to parameter: 27
[2014-09-09 10:48:28,009] TRACE [tibemsd] (NullableType.java:133) - binding 'false' to parameter: 28
[2014-09-09 10:48:28,009] TRACE [tibemsd] (NullableType.java:133) - binding '123' to parameter: 29
[2014-09-09 10:48:28,009] TRACE [tibemsd] (NullableType.java:133) - binding '337' to parameter: 32
[2014-09-09 10:48:28,085] DEBUG [tibemsd] (AbstractBatcher.java:424) - select message0_.STORE_ID as STORE1_17_0_, message0_.MESSAGE_SEQNO as MESSAGE2_17_0_, message0_.TYPE as TYPE17_0_, message0_.PRIORITY as PRIORITY17_0_, message0_.DELIVERYMODE as DELIVERY5_17_0_, message0_.REDELIVERED as REDELIVE6_17_0_, message0_.DELIVERY_COUNT as DELIVERY7_17_0_, message0_.DESTINATION as DESTINAT8_17_0_, message0_.DESTINATION_TYPE as DESTINAT9_17_0_, message0_.EXPIRATION as EXPIRATION17_0_, message0_.TIMESTAMP as TIMESTAMP17_0_, message0_.DELIVERYTIME as DELIVER12_17_0_, message0_.REPLYTO as REPLYTO17_0_, message0_.REPLYTO_TYPE as REPLYTO14_17_0_, message0_.USERTYPE as USERTYPE17_0_, message0_.MSGID as MSGID17_0_, message0_.CORRELATIONID as CORRELA17_17_0_, message0_.COMPRESSED as COMPRESSED17_0_, message0_.CLIENTFLAGS as CLIENTF19_17_0_, message0_.ENCODING as ENCODING17_0_, message0_.ENCODED_PROPERTIES as ENCODED21_17_0_, message0_.ENCODED_SUPPRESS_CONSIDS as ENCODED22_17_0_, message0_.TXNID as TXNID17_0_, message0_.ZONEID as ZONEID17_0_, message0_.ROUTESRC as ROUTESRC17_0_, message0_.ROUTESEQNO as ROUTESEQNO17_0_, message0_.ROUTECONSID as ROUTECO27_17_0_, message0_.PRODUCERID as PRODUCERID17_0_, message0_.DELETED as DELETED17_0_, message0_.MESSAGE_SIZE as MESSAGE30_17_0_, message0_.SMALL_MESSAGE_BODY as SMALL31_17_0_, message0_.LARGE_MESSAGE_BODY as LARGE32_17_0_ from EMS_MESSAGES message0_ where message0_.STORE_ID=?
[2014-09-09 10:48:28,085] TRACE [tibemsd] (NullableType.java:133) - binding '247' to parameter: 1
[2014-09-09 10:48:28,087] TRACE [tibemsd] (NullableType.java:172) - returning '247' as column: MESSAGE2_17_0_
[2014-09-09 10:48:28,087] TRACE [tibemsd] (NullableType.java:172) - returning '3' as column: TYPE17_0_
[2014-09-09 10:48:28,087] TRACE [tibemsd] (NullableType.java:172) - returning '4' as column: PRIORITY17_0_
[2014-09-09 10:48:28,087] TRACE [tibemsd] (NullableType.java:172) - returning '2' as column: DELIVERY5_17_0_
[2014-09-09 10:48:28,087] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: REDELIVE6_17_0_
[2014-09-09 10:48:28,087] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: DELIVERY7_17_0_
[2014-09-09 10:48:28,088] TRACE [tibemsd] (NullableType.java:172) - returning 'test.fw1' as column: DESTINAT8_17_0_
[2014-09-09 10:48:28,088] TRACE [tibemsd] (NullableType.java:172) - returning '1' as column: DESTINAT9_17_0_
[2014-09-09 10:48:28,088] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: EXPIRATION17_0_
[2014-09-09 10:48:28,088] TRACE [tibemsd] (NullableType.java:172) - returning '1410249505675' as column: TIMESTAMP17_0_
[2014-09-09 10:48:28,088] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: DELIVER12_17_0_
[2014-09-09 10:48:28,088] TRACE [tibemsd] (NullableType.java:166) - returning null as column: REPLYTO17_0_
[2014-09-09 10:48:28,088] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: REPLYTO14_17_0_
[2014-09-09 10:48:28,088] TRACE [tibemsd] (NullableType.java:166) - returning null as column: USERTYPE17_0_
[2014-09-09 10:48:28,089] TRACE [tibemsd] (NullableType.java:172) - returning 'ID:EMS-SERVER-DC2.32DC540EB2EE4:141' as column: MSGID17_0_
[2014-09-09 10:48:28,089] TRACE [tibemsd] (NullableType.java:166) - returning null as column: CORRELA17_17_0_
[2014-09-09 10:48:28,089] TRACE [tibemsd] (NullableType.java:172) - returning 'false' as column: COMPRESSED17_0_
[2014-09-09 10:48:28,089] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: CLIENTF19_17_0_
[2014-09-09 10:48:28,089] TRACE [tibemsd] (NullableType.java:166) - returning null as column: ENCODING17_0_
[2014-09-09 10:48:28,089] TRACE [tibemsd] (NullableType.java:166) - returning null as column: ENCODED21_17_0_
[2014-09-09 10:48:28,089] TRACE [tibemsd] (NullableType.java:166) - returning null as column: ENCODED22_17_0_
[2014-09-09 10:48:28,089] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: TXNID17_0_
[2014-09-09 10:48:28,090] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: ZONEID17_0_
[2014-09-09 10:48:28,090] TRACE [tibemsd] (NullableType.java:166) - returning null as column: ROUTESRC17_0_
[2014-09-09 10:48:28,090] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: ROUTESEQNO17_0_
[2014-09-09 10:48:28,090] TRACE [tibemsd] (NullableType.java:172) - returning '0' as column: ROUTECO27_17_0_
[2014-09-09 10:48:28,090] TRACE [tibemsd] (NullableType.java:172) - returning '1' as column: PRODUCERID17_0_
[2014-09-09 10:48:28,090] TRACE [tibemsd] (NullableType.java:172) - returning 'false' as column: DELETED17_0_
[2014-09-09 10:48:28,090] TRACE [tibemsd] (NullableType.java:172) - returning '125' as column: MESSAGE30_17_0_

Gdyby numer sekwencji komunikatu był trzymany w bazie (Hibernate IdentifierGenerator = native/sequence) a nie był typem long trzymanym w pamięci to wiele instancji EMS-a mogłoby korzystać z tego samego schematu bazodanowego.

środa, września 03, 2014

Why does EMS have poor client initialization concurrency?

"TibemsXAUniConnectionHandler/pushConnection-336" daemon prio=6 tid=0x000000000fbde000 nid=0x1e58 waiting for monitor entry [0x0000000026dce000]
   java.lang.Thread.State: BLOCKED (on object monitor)
at com.tibco.tibjms.TibjmsxLinkTcp._createSocket(TibjmsxLinkTcp.java:797)
- waiting to lock <0x00000000fdea8b90> (a java.lang.Object)
at com.tibco.tibjms.TibjmsxLinkTcp.connect(TibjmsxLinkTcp.java:914)
at com.tibco.tibjms.TibjmsConnection._create(TibjmsConnection.java:1354)
at com.tibco.tibjms.TibjmsConnection.(TibjmsConnection.java:4320)
at com.tibco.tibjms.TibjmsXAConnection.(TibjmsXAConnection.java:30)
at com.tibco.tibjms.TibjmsXAQueueConnection.(TibjmsXAQueueConnection.java:29)
at com.tibco.tibjms.TibjmsxCFImpl._createImpl(TibjmsxCFImpl.java:164)
at com.tibco.tibjms.TibjmsxCFImpl._createConnection(TibjmsxCFImpl.java:253)
at com.tibco.tibjms.TibjmsXAQueueConnectionFactory.createXAQueueConnection(TibjmsXAQueueConnectionFactory.java:111)
at com.tibco.tibjms.XConnectionHandler$2.run(XConnectionHandler.java:201)

Process of connecting is degraded to single threaded processing due to private static Object _shutdownLock over which almost everything is synchronized inside TibjmsxLinkTcp class including socket creation and heartbeat processing. Fixing this lock (degrading from static) we step down from 8 seconds to 120ms on connection establishing while allocating 20 connections with 10 seconds heartbeat.

czwartek, sierpnia 21, 2014

What is the best JCA JMS Resource Adapter for JBoss 5.1, JBoss 7.1?

JMS JCA RA written by Frank Kieviet for SeeBeyond Technology Corporation and later developed at Sun Microsystems in JCAPS/OpenESB.

środa, sierpnia 20, 2014

GenericRa.rar with JBoss 5.1 and Oracle AQ


Generic JMS RA from Glassfish (created by Sun Microsystems, maintained by Oracle Corporation) is usable with Oracle AQ.

Adjust system properties:
oracle.jms.traceLevel=6
oracle.jms.useNativeXA=true
oracle.jms.useEmulatedXA=false
oracle.jms.j2eeCompliant=false.

<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
          name="jboss.messaging:service=JMSProviderLoader,name=AQProvider">
      <attribute name="ProviderName">DefaultAQProvider</attribute>
      <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
      <attribute name="FactoryRef">XAConnectionFactory</attribute>
      <attribute name="QueueFactoryRef">XAQueueConnectionFactory</attribute>
      <attribute name="TopicFactoryRef">XATopicConnectionFactory</attribute>
 <attribute name="Properties">
java.naming.factory.initial=oracle.jms.AQjmsInitialContextFactory
java.naming.security.principal=XA
java.naming.security.credentials=toortoor
db_url=jdbc:oracle:thin:@localhost:1521:XE
datasource=java:XAOracleDS
 </attribute>
   </mbean>

wtorek, sierpnia 19, 2014

ConnectionConsumer API for AQjmsConnection

public synchronized ConnectionConsumer createConnectionConsumer(
Destination destination, String s,
ServerSessionPool serversessionpool, int i) throws JMSException {
//AQjmsError.throwEx(102);
return _createConnectionConsumer(destination, null, s, serversessionpool, i);
}

private ConnectionConsumer _createConnectionConsumer(final Destination destination,
final String sub, final String s, final ServerSessionPool spool, final int max) {

return new ConnectionConsumer() {

private boolean closed = false;
private final LinkedBlockingQueue<Long> trigger = new LinkedBlockingQueue<Long>();
private AtomicLong counter = new AtomicLong(0);
@SuppressWarnings("unused")
private Thread bootstrapThread = bootstrapConsumers();

@Override
public ServerSessionPool getServerSessionPool() throws JMSException {
return spool;
}

@Override
public void close() throws JMSException {
closed = true;
}

public Thread bootstrapConsumers() {
Thread coordinator = new Thread() {
public void run() {
setName("ConsumerCoordinator "+Thread.currentThread().getId());
long lastCnt = 0;
while (!closed) {
Long value = null;
try {
value = trigger.poll(1, TimeUnit.SECONDS);
}
catch (InterruptedException e) {}
if ((value!=null && counter.get() < max) && !closed) {
Thread th = new Thread() {
public void run() {
runConsumer();
}
};
th.setDaemon(true);
th.start();
}
long currentCnt = counter.get();
if (currentCnt!=lastCnt) {
System.out.println("Server session pool #"+spool.hashCode()+" has got active "+counter.get()+" session(s), max is "+max);
lastCnt = currentCnt;
}
}
}
};
coordinator.setDaemon(true);
coordinator.start();
trigger.add(System.currentTimeMillis());
return coordinator;
}

public void runConsumer() {
Thread.currentThread().setName("Connection consumer "+Thread.currentThread().getId());
counter.incrementAndGet();
ServerSession ss = null;
Session sess = null;
MessageListener appSrvMessageListener = null;

while (!closed) {
try {
if (ss==null) {
ss = spool.getServerSession(); /* app srv will block */
trigger.put(System.currentTimeMillis());
sess = ss.getSession();
appSrvMessageListener = sess.getMessageListener();
}
if (sess==null) {
sess = ss.getSession();
}
sess.setMessageListener(null);
MessageConsumer mc = (sub!=null) ?
sess.createDurableSubscriber((Topic) destination, sub, s, false) :
sess.createConsumer(destination, s);

while (!closed) {
LinkedList list = new LinkedList();
int limit = 1; /* XA: one transaction per message */
for (int i=0; i < limit; i++) {
Message m = null;
try {
m = (i==limit-1) ? mc.receive(1000) : mc.receiveNoWait();
if (m!=null)
list.add(m);
}
catch (Exception e) {
System.out.println("Error while trying to receive message from JMS server, destination="+destination+", subscription="+sub+", selector="+s+": "+ e);
try {
sess.close();
}
catch (Exception ee) {}
sess = null;
break;
}
}
if (sess==null)
break;

if (!list.isEmpty()) {
synchronized (ss) {
for (Message m : list)
appSrvMessageListener.onMessage(m);
/*ss.start();*/
}
}
}
}
catch (Exception exception) {
System.out.println("Cannot consume JMS connection (but will retry), destination="+destination+", subscription="+sub+", selector="+s+": "+ exception);
try {
if (sess!=null)
sess.close();
}
catch (Exception e) {}
}
}
counter.decrementAndGet();
Logger.debug("EMS Connection Consumer closed (permanently), destination="+destination+", subscription="+sub+", selector="+s);
Logger.debug("Connection #"+hashCode()+" consumer counter is "+counter.get());
}
};
}

Oracle AQ XA Connection

There is a bug in aqapi.jar AQjmsGeneralDBConnection which prevents usage of XA outside Oracle WebLogic.

Here is a bugfix:

private String getProviderKey() throws JMSException {
try {
OracleConnection oracleconnection = (OracleConnection) m_dbConn;
+ if (oracleconnection==null)
+ oracleconnection = (OracleConnection) m_xaConn.getConnection();
String s = oracleconnection.getURL();
int i = s.indexOf('@');
String s1;
if (i < 0) {
if (!"jdbc:oracle:kprb:".equals(((Object) (s)))
&& !"jdbc:default:connection:".equals(((Object) (s))))
AQjmsError.throwEx(112);
s1 = "jdbc:oracle:kprb:";
} else {
s1 = s.substring(i);
}
return s1.toUpperCase();
} catch (SQLException sqlexception) {
throw new AQjmsException(sqlexception);
}
}

oracle.jms.traceLevel=6
oracle.jms.useNativeXA=true
oracle.jms.useEmulatedXA=false
oracle.jms.j2eeCompliant=true

execute dbms_aqadm.create_queue_table(queue_table => 'XA.JMS_Q_STORE001', queue_payload_type => 'sys.aq$_jms_message', multiple_consumers => false);
execute dbms_aqadm.create_queue(queue_name => 'XA.test_fw1', queue_table => 'XA.JMS_Q_STORE001');
execute dbms_aqadm.start_queue('XA.test_fw1')
@ActivationConfigProperty(propertyName = "destination", propertyValue = "Queues/test_fw1"),

czwartek, sierpnia 14, 2014

jbossts-properties.xml

<properties depends="arjuna" name="jta">
    <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBM01"  value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:DefaultJMSProvider"/>
    <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.EMS01"  value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:DefaultEMSProvider"/>
<property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.Oracle" value="com.arjuna.ats.internal.jdbc.recovery.OracleXARecovery;oraclejta-properties.xml"/>
    <property name="com.arjuna.ats.jta.xaRecoveryNode" value="1"/>
</properties>

środa, sierpnia 13, 2014

Bardzo ładny Linux

ElementaryOS. Ładne czcionki, ładne kolory, kontrasty. Menedżer plików pamięta ostatnią lokalizację.


wtorek, sierpnia 12, 2014

MySQL to amatorska baza danych


Nowy Yaris

Auto miejskie dla pań nie powinno mieć ostrego i agresywnego wyglądu. Toyota naprawia błąd. Facelifting wprowadza krągłości oraz sporo wersji wyposażenia, od takiej bez klimatyzacji do takiej z dachem panoramicznym. Hybryda też ma szeroki zakres opcji. Jeżdżący po ulicach Yaris II to auto unikalne i kultowe. Pewnie VW Polo w topowej wersji ma nowocześniejsze technologie, ale poprawiony Yaris jest po prostu sympatyczny (tak jak druga generacja).






How to merge external context with JBoss global context

<mbean code="org.jboss.naming.ExternalContext" name="jboss.jndi:service=ExternalContext,jndiName=external/ems">
    <attribute name="JndiName">external/ems</attribute>
 <attribute name="Properties">
     java.naming.factory.initial=com.tibco.tibjms.CompanionContext
  java.naming.provider.url=external
  queues=test.bw1,test.fw1
  topics=topic1
 </attribute>
 <attribute name="InitialContext">com.tibco.tibjms.CompanionContext</attribute>
    <attribute name="RemoteAccess">true</attribute>
   </mbean>
   
   @Resource(mappedName = "external/ems/test.fw1", name = "external/ems/test.fw1")
 private Queue testFw1 = null;

//CompanionContext implements own lookup() methods

How to trace JBoss EJB property injection

package org.jboss.injection;

import java.util.Arrays;
import javax.naming.*;
import org.jboss.ejb3.BeanContext;
import org.jboss.ejb3.JndiUtil;
import org.jboss.injection.AbstractPropertyInjector;
import org.jboss.injection.PojoInjector;
import org.jboss.injection.lang.reflect.BeanProperty;
import org.jboss.logging.Logger;

public class JndiPropertyInjector extends AbstractPropertyInjector implements PojoInjector {

public JndiPropertyInjector(BeanProperty property, String jndiName,
Context ctx) {
super(property);
this.jndiName = jndiName;
this.ctx = ctx;
}

public void inject(BeanContext bctx) {
System.out.println("bctx="+bctx+", instance="+bctx.getInstance()+", jndi="+jndiName);
try {
inject(bctx, bctx.getInstance());
}
catch (Exception e) {
System.err.println("failed property="+property);
System.err.println("property="+property.getName());
}
}
        /* ... */
}

piątek, sierpnia 08, 2014

Małe duże kultowe auto









EMS 8.1 tibemsd.conf recommendations

EMS data files should be located on filesystem mounted with noatime!

network_thread_count = 8
flow_control = disabled
routing = disabled
xa_default_timeout = 300
destination_backlog_swapout = 3000
max_msg_memory = 5808MB
msg_pool_block_size = 4096
msg_swapping = enabled
reserve_memory = 64M
socket_send_buffer_size = 64K
socket_receive_buffer_size = 64K
logfile = primary.log
secondary_logfile = secondary.log
logfile_max_size = 10MB
statistics = enabled
rate_interval = 20
server_rate_interval = 20
max_stat_memory = 64MB
detailed_statistics = PRODUCERS,CONSUMERS
jre_option = -Xmx2g

client_heartbeat_server=10
server_heartbeat_server=10
server_heartbeat_client=10
ft_heartbeat=10
ft_activation=30
ft_reconnect_timeout=30
server_timeout_client_connection=60
client_timeout_server_connection=60
server_timeout_server_connection=60 (30 for hot-standby)

log_trace=DEFAULT,+ACL,+ADMIN,+CONFIG,-CONNECT,+CONNECT_ERROR,-DEST,+FLOW,+INFO,+LIMITS,+MEMORY,-MSG,-PRODCONS,+TX,+WARNING
console_trace=ADMIN,CONFIG

Java properties for EMS Push Provider:
ems.CONNECT_TIME=20000
ems.PING_TIME=40000
ems.WARN_TIME_NO_CONNECTION=60000
ems.FAIL_TIME_NO_CONNECTION=300000
ems.ELECTION_TIME=5000
ems.DEBUG=1
ems.NATIVE_MODE=0

wtorek, lipca 15, 2014

Swiss Army Network Tool

Kieszonkowe narzędzie 3G WIFI ROUTER:
  • WiFi -> WiFi
  • WiFi -> LAN
  • WAN -> WiFI
  • bateria i ładowarka do telefonu
  • może być zasilane z dużego USB

How to get Hawk JMX data from BW

try {
    Set<objectinstance> result = conn.queryMBeans(new ObjectName("com.tibco.bw:key=engine,name=*"), null);
    if (result.size() > 0) {
     ObjectInstance tib = result.iterator().next();
     TabularDataSupport getActivities = (TabularDataSupport) conn.invoke(tib.getObjectName(), "GetActivities", new Object[] { null }, null);
     TabularDataSupport getProcesses = (TabularDataSupport) conn.invoke(tib.getObjectName(), "GetProcesses", new Object[] { 0, null, 0, 0, null }, null);
           
 for (Object _row : getProcesses.values()) {
     BWStats bw = new BWStats();
            CompositeData row = (CompositeData)_row;
            bw.process = (String) row.get("MainProcessName"); 
            bw.activity = (String) row.get("CurrentActivityName");
            bw.clazz = "IN";
            bw.status = (String) row.get("Status");
            bw.duration0 = (Long) row.get("Duration");  
            stats.bwStats.add(bw);
        }
           
        for (Object _row : getActivities.values()) {
            CompositeData row = (CompositeData)_row;
            BWStats bw = new BWStats();
            bw.process = (String) row.get("ProcessDefName"); 
            bw.activity = (String) row.get("Name");
            bw.clazz = (String) row.get("ActivityClass");
            bw.duration0 = (Long) row.get("ExecutionTime");
            bw.duration1 = (Long) row.get("ElapsedTime");
            bw.count = (Long) row.get("ExecutionCount");   
            stats.bwStats.add(bw);
    }
}
catch (Exception exc) {}

sobota, lipca 05, 2014

Auris I hybrid ma bardzo mały bagażnik

środa, lipca 02, 2014

Jacek Braciak o OFE

czwartek, czerwca 26, 2014

Sprawdzanie używanego japończyka


1. Sprawdzenie lakieru miernikiem (wcisnąć start i przytrzymać 5 sekund): błotniki, okolice drzwi koło błotników, środek drzwi, progi, drzwi przy progach, maska i klapa bagażnika, słupki i krawędź dachu. Wartości: 80um - spolerowany lakier np. żeby usunąć rysy, 120um - oryginalny lakier, 200um - druga warstwa lakieru, wszystko powyżej - szpachla. Niemieckie auta mają grubszy lakier (150/180/350). Lakier nie metalik jest cieńszy.






2. Sprawdzenie sygnatur na wszystkich szybach, czy są z jednej serii.

3. Sprawdzenie spalin ma wolnych obrotach i po przygazowaniu: kolor białawy, ciemny, woda w spalinach.

4. Sprawdzenie nakrętek pod maską, gwintów - czy geometria jest zachowana, czy nie było kręcenia na siłę, porysowania.

poniedziałek, czerwca 23, 2014

Modna firanka

Firanka Inspire Flock + klips magnetyczny Stolkar Kwiatek. Przez niepofałdowaną firankę lepiej widać świat na zewnątrz.

niedziela, czerwca 22, 2014

Afera taśmowa w pytaniach i odpowiedziach

1. Skąd wiadomo, że Sienkiewicza na rozmowę z Belką wysłał Tusk?
B. i S. wymieniają premiera jako partnera do rozmów i decydenta. S. nie ma takiej pozycji w partii, że mógłby na jej rzecz prowadzić takie negocjacje. Poza tym jest na tyle głupi, że jako szef służb dał się nagrać. Nie mógł być mózgiem operacji.

2. Skąd wiadomo, że Sienkiewicz steruje śledztwem?
Nasłany na Wprost prokurator był na tyle tępy, że nie znał prawa prasowego. Ślepo wypełniał odgórne nakazy. Trzymał się tej samej wersji, co Tusk na późniejszej konferencji.

3. Skąd wiadomo, że Tusk to przestępca w białym kołnierzyku?
Bo zostawił Sienkiewicza na stanowisku w celu zaduszenia afery. Bo zapłacił Relidze pieniędzmi za poparcie w wyborach.

czwartek, czerwca 19, 2014

Temat bieżący

Sienkiewicz boi się pokazać publicznie od czasu afery, żeby dziennikarze nie zapytali go o szczegóły rozmów. Wtedy mógłby powiedzieć coś sprzecznego z zawartością taśm. Musi ustalić co na niego mają i jak się tłumaczyć. W tym celu nasłał prokuraturę i ABW na Latkowskiego, żeby skonfiskowali mu WSZYSTKIE taśmy (potwierdził to Tusk na konferencji prasowej). Nasłał bezprawnie. Oprócz praw ogólnych istnieją szczegółowe: należy zabezpieczyć dowody w sprawie o podsłuchiwanie w taki sposób, żeby nie naruszyć prawa dziennikarzy do nieujawniania informatora. Prokuratura powinna wystąpić do sądu o wydanie opinii w tej sprawie w jaki sposób powinno to nastąpić. Wyrywanie Latkowskiemu latopa z wykręcaniem rąk i palców jest metodą w stylu Putina i Łukaszenki. Funkcjonariusze ABW nie umieli skopiować nagrać z Mac-a i dlatego chcieli zabrać całego latopa. Minister nadzorujący służby szlaja się po mieście bez osłony kontrwywiadowczej i prowadzi, zbliżone do mafijnych, rozmowy. Reszta rządu podobnie. Być może pierwszym i ostatnim ogniwem afery jest kelner porażony rozkładem państwa na szczytach jego władzy. Przekazał nagrania mediom. Teraz ściga go Sienkiewicz - sprawca i winny całej afery. Niekompetentny i bezczelny. Ten rząd musi odejść.

wtorek, czerwca 17, 2014

JMX query for Tibco BW

public static class VMStats {
 String nameOrDesc = "UNKNOWN";
 int memUsage = 0;
 int memMax = 0;
 int cpuUsage = 0;
 int gcUsage = 0;
 int cores = 0;
 int overloaded = 0;
  
 public void toStdout() {
  System.out.println(String.format("%s|%d|%d|%d|%d|%d|%d", nameOrDesc, memUsage, memMax, cpuUsage, gcUsage, cores, overloaded));   
 }
}

public final static VMStats query(VirtualMachineDescriptor vmd, CyclicBarrier sync) throws Exception {
 VirtualMachine vm = VirtualMachine.attach(vmd);
 long timeStart = System.currentTimeMillis();
 try {
  String address = vm.getAgentProperties().getProperty("com.sun.management.jmxremote.localConnectorAddress");
  MBeanServerConnection conn = null;
  for (int i=0; i < 2; i++) {
   try {
    if (address == null) {
     String javaHome = vm.getSystemProperties().getProperty("java.home");
     File managementAgentJarFile = new File(javaHome + File.separator + "lib" + File.separator + "management-agent.jar");
     vm.loadAgent(managementAgentJarFile.getAbsolutePath());
     address = vm.getAgentProperties().getProperty("com.sun.management.jmxremote.localConnectorAddress");
    }
    JMXServiceURL jmxUrl = new JMXServiceURL(address);
           conn = JMXConnectorFactory.connect(jmxUrl).getMBeanServerConnection();
   }
   catch (Exception e) {
    if (i==0) {
     address = null; /* try to reload agent */
    }
    else
     throw e;
   }
  }
  String file = vm.getSystemProperties().getProperty("wrapper.tra.file");
         MemoryMXBean memBean = ManagementFactory.newPlatformMXBeanProxy(conn, ManagementFactory.MEMORY_MXBEAN_NAME, MemoryMXBean.class);
         RuntimeMXBean rtBean = ManagementFactory.newPlatformMXBeanProxy(conn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
         OperatingSystemMXBean osBean = ManagementFactory.newPlatformMXBeanProxy(conn, ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME, OperatingSystemMXBean.class);
         
         long memMax = (memBean.getHeapMemoryUsage().getMax() + memBean.getNonHeapMemoryUsage().getMax());
  int memUsage = (int)(100.0 * (memBean.getHeapMemoryUsage().getUsed() + memBean.getNonHeapMemoryUsage().getUsed()) / memMax);
         int memMB = (int) (memMax / 1024 / 1024);
         long time0 = osBean.getProcessCpuTime();
         long refTime0 = System.currentTimeMillis();
         Thread.sleep(1000);
         double load = (osBean.getProcessCpuTime() - time0) / (System.currentTimeMillis() - refTime0) / 10000.0;
         if (Double.isInfinite(load) || Double.isNaN(load) || load < 0)
          load = 0;
  load = Math.round(load);
         String appId = "PID|"+vm.id() + "|"+rtBean.getSystemProperties().get("user.dir");
   if (file!=null) {
          appId = file.endsWith(".tra") ? "TRA|"+file.substring(file.lastIndexOf(File.separator+"")+1) : appId;
  }
         long gcDiff = 0;
  List gcmbList = ManagementFactory.getGarbageCollectorMXBeans();
  long[] gcTime = new long[gcmbList.size()];
         for (int i=0; i < 5; i++) {
          for (int j=0; j < gcmbList.size(); j++) {
           GarbageCollectorMXBean gcBean = ManagementFactory.newPlatformMXBeanProxy(conn, gcmbList.get(j).getObjectName().toString(), GarbageCollectorMXBean.class);
           if (i > 0)
     gcDiff += (gcBean.getCollectionTime() - gcTime[j]);
           gcTime[j] = gcBean.getCollectionTime();
          }
          if (i!=4)
           Thread.sleep(1000);
         }
         VMStats stats = new VMStats();
         stats.nameOrDesc = appId;
         stats.memUsage = memUsage;
         stats.memMax = memMB;
         stats.cpuUsage = (int) load;
         stats.gcUsage = (int) gcDiff;
         stats.cores = osBean.getAvailableProcessors();
         stats.overloaded = System.currentTimeMillis() - timeStart >= 60000 ? 1 : 0;
         if (vm.getSystemProperties().getProperty("VMSTAT_TOKEN", "").equals(System.getProperty("VMSTAT_TOKEN")))
          stats.nameOrDesc = ""; /* this is me */
         return stats;
 }
 finally {
  vm.detach();
 }
}

public void invoke() { 
 List list = VirtualMachine.list();
 ExecutorService es = Executors.newFixedThreadPool(list.size()+1);
 final CyclicBarrier sync = new CyclicBarrier(list.size()+1);
 final ConcurrentLinkedQueue result = new ConcurrentLinkedQueue();  
 System.setProperty("VMSTAT_TOKEN", System.currentTimeMillis()+"X"+Thread.currentThread().getId());
  
 for (final VirtualMachineDescriptor vmd : list) {
  Runnable r = new Runnable() {
   public void run() {
    try {
     VMStats stats = query(vmd, sync);
     if (!("".equals(stats.nameOrDesc)))
      result.add(stats);
    }
    catch (Exception e) {
     new RuntimeException("Error while querying JMX for "+vmd.id(), e).printStackTrace();
     VMStats vms = new VMStats();
     vms.nameOrDesc = "PID|"+vmd.id()+"|"+vmd.id();
     vms.overloaded = 1;
     result.add(vms);
    }
    finally {
     try {
      sync.await(180, TimeUnit.SECONDS);
     }
     catch (Exception e) {}
    }
   }
  };
                es.execute(r);  
 }
 try {
  sync.await(180, TimeUnit.SECONDS);
 }
 catch (Exception te) {}
 es.shutdownNow();
 try {
  Thread.sleep(1000);
 }
 catch (InterruptedException e) {}
 
 while (result.size() > 0) {
         result.remove().toStdout();
 }
}
 
public final static void main(String[] args) {
 new VMStat().invoke();
 try {
  Thread.sleep(1000);
 }
 catch (InterruptedException e) {}
 System.exit(0);  
}

poniedziałek, czerwca 16, 2014

How to check number of threads per Tibco BW instance

ps -efT | grep tibco | awk '{print $13}' > /tmp/all-proc.txt; for f in `ps -efT | grep tibco | awk '{print $13}' | sort -u`; do echo $f; grep -c $f /tmp/all-proc.txt; done

Temat zastępczy Chazan

Straszliwe kolejki do specjalistów w służbie zdrowia. Chorzy czekają latami - jeśli dożyją. Ludzi ze szpitala wyrzuca się zaraz po zabiegu, bo NFZ płaci tylko za pierwsze dni. No i tutaj trafia się Arłukowiczowi szansa żeby zabłysnąć: próbuje się wmówić ludziom, że jest taki wymóg prawny, żeby lekarz na życzenie pacjentki zabijał dzieci, a jeśli lekarz odmawia to łamie prawo i jest to niehumanitarne, skandaliczne i oburzające. Ponadto lekarz nie powinien odmawiać, bo to państwo płaciło za jego studia. Chazan pownien powiedzieć wprost, że nieudolny minister i rząd szukają tematów zastępczych. Dziecko też jest pacjentem. Arłukowicz pomyślał, że zarządzi kontrole, znajdzie kwity na cały szpital, uratuje ludzi od straszliwego "doktora sumienie" i dzięki temu notowania mu wzrosną, bo ludzie zapomną o sytuacji w służbie zdrowia. Porażający cynizm i głupota.

wtorek, czerwca 10, 2014

Klauzula sumienia

Art. 31.1. Wolność człowieka podlega ochronie prawnej.
Art. 31.2. Każdy jest obowiązany szanować wolności i prawa innych. Nikogo nie wolno zmuszać do czynienia tego, czego prawo mu nie nakazuje.
Art. 32.2. Nikt nie może być dyskryminowany w życiu politycznym, społecznym lub gospodarczym z jakiejkolwiek przyczyny.
Art. 38. Rzeczpospolita Polska zapewnia każdemu człowiekowi prawną ochronę życia.
Art. 47. Każdy ma prawo do ochrony prawnej życia prywatnego, rodzinnego, czci i dobrego imienia oraz do decydowania o swoim życiu osobistym.
Art. 53.1. Każdemu zapewnia się wolność sumienia i religii.
Art. 54.1. Każdemu zapewnia się wolność wyrażania swoich poglądów oraz pozyskiwania i rozpowszechniania informacji.
Art. 72.1. Rzeczpospolita Polska zapewnia ochronę praw dziecka. Każdy ma prawo żądać od organów władzy publicznej ochrony dziecka przed przemocą, okrucieństwem, wyzyskiem i demoralizacją.

czwartek, czerwca 05, 2014

EMS: 40 sessions in 1 connection or 40 connection with 1 session

final TibjmsQueueConnectionFactory cf = new TibjmsQueueConnectionFactory();
cf.setServerUrl("tcp://localhost:7222");
cf.setUserName("admin");
cf.setUserPassword("Adm1n");

final QueueConnection qc = cf.createQueueConnection();
QueueSession qs = qc.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
QueueSender qsnd = qs.createSender(qs.createQueue("1n_n1"));
qc.start();

final AtomicInteger toDo = new AtomicInteger(0);
final AtomicInteger[] sum = new AtomicInteger[2];

int[] sessionPerConnIters = { 1, 0 };

for (final int mode : sessionPerConnIters) {
sum[mode] = new AtomicInteger(0);
for (int i=0; i < 100; i++) {
TextMessage msg = qs.createTextMessage(MESSAGE);
msg.setIntProperty("TEST", 1);
qsnd.send(msg);
}
toDo.set(100);
final CyclicBarrier cb = new CyclicBarrier(41);
for (int i=0; i < 40; i++) {
new Thread() {
public void run() {
try {
QueueConnection _qc = (mode == 1) ? cf.createQueueConnection() : qc;
_qc.start();
QueueSession _qs = _qc.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
QueueReceiver _qr = _qs.createReceiver(_qs.createQueue("1n_n1"), "TEST=1");

long t1 = System.currentTimeMillis();

while (toDo.get() > 0) {
TextMessage m = (TextMessage) _qr.receive(100);
long t2 = System.currentTimeMillis();
if (m!=null) {
if (mode == 1)
System.out.println("Message recv time = "+(t2-t1)+" ms");
else
System.err.println("Message recv time = "+(t2-t1)+" ms");
sum[mode].addAndGet((int) (t2-t1));
m.acknowledge();
toDo.decrementAndGet();
t1 = t2;
}
}
cb.await();
_qs.close();
if (mode == 1)
_qc.close();
}
catch (Exception exc) {
exc.printStackTrace();
}
}
}.start();
}
cb.await();
}
qc.close();
for (int i=0; i < sum.length; i++) {
System.out.println("Full time of all threads: "+sum[i].get()+", sessionPerConn="+sessionPerConnIters[i]);
}
}

Full time of all threads: 46554, sessionPerConn=1
Full time of all threads: 53262, sessionPerConn=0
20 threads, 4MB

Full time of all threads: 262, sessionPerConn=1
Full time of all threads: 403, sessionPerConn=0
20 threads, 4KB

Full time of all threads: 79, sessionPerConn=1
Full time of all threads: 72, sessionPerConn=0
 5 threads, 4KB

--
Full time of all threads: 14866, sessionPerConn=1 Full time of all threads: 26016, sessionPerConn=0 20, 1MB Full time of all threads: 6486, sessionPerConn=1 Full time of all threads: 9073, sessionPerConn=0 15, 1MB Full time of all threads: 4181, sessionPerConn=1 Full time of all threads: 6366, sessionPerConn=0 10, 1MB Full time of all threads: 2249, sessionPerConn=1 Full time of all threads: 2646, sessionPerConn=0 5, 1MB Full time of all threads: 1870, sessionPerConn=1 Full time of all threads: 2093, sessionPerConn=0 4, 1MB Full time of all threads: 1391, sessionPerConn=1 Full time of all threads: 1246, sessionPerConn=0 3, 1MB --- Full time of all threads: 192, sessionPerConn=1 Full time of all threads: 251, sessionPerConn=0 20, 1KB Full time of all threads: 181, sessionPerConn=1 Full time of all threads: 165, sessionPerConn=0 15, 1KB Full time of all threads: 163, sessionPerConn=1 Full time of all threads: 137, sessionPerConn=0 10, 1KB
--
Conclusion: When using above 20 sessions per connection 1:1 connection/session model is faster than 1:n approach.

poniedziałek, czerwca 02, 2014

Czersk