The purpose of this tutorial is to help you configure two iDempiere instances to communicate via replication. One instance will act as a 'data source' and the second instance will act as a 'data target'.
Replication Introduction
Replication Scenarios
Replication Scenario - 3rd
Replication Options
Replication - ActiveMQ Concepts
Queues vs. Topics
Queue - only one subscriber gets a message. Supports load-balancing
Topic - all subscribers get a message
Durable vs Non-Durable
Durable - supports registered but not connected subscribers
Can you view Topics - No… Yes… It Depends….
Also, there is a way to create a queue subscriber to a topic
Review below notes before watching this video. Execute the below SQL delete statements before watching this video.
Important Notes:
One thing I forgot to show is to delete all the previously installed Export Format lines that come with Gardenworld and System. You will want to do this using the below SQL statements. If you neglect to do this, the records that exist for Client = "System" will not work. For example, if you try to replicate C_Order (whose default Export Format records belong to the System client), you will get errors because your XML message will not be complete.
The default output of Export Format Generator will result in many of the Export Format records with isActive = 'N'. You will want to activate these records is most if not all situations. Use the below SQL update statement to perform this task automatically (assuming you have created your Replication Strategy => Replication Table records already).
The Format Line => Type of "Referenced EXP Format" if very expensive. In most cases, you will want to change this to "XML Element". When the system processes an Referenced EXP Format, it recursively digs to the deepest most object. To give you an example, adding C_BPartner_ID to the newly created chuboe_table causes much overhead. By changing C_BPartner_ID's Type from "Referenced EXP Format" to "XML Element" made the system much faster. The one time you will want to keep the "Referenced EXP Format" is when a child record points to its parent. For example when C_OrderLine.C_Order_ID points to its parent record.
SQL to delete initially installed Export Format and Replication Strategy records:
delete from exp_formatline;
delete from exp_format;
delete from AD_ReplicationTable;
SQL to make the applicable newly created Export Format Lines active:
update exp_formatline
set isactive = 'Y'
where exp_formatline_id in
(select fl.exp_formatline_id
from AD_ReplicationTable r
join exp_format f on (r.ad_table_id = f.ad_table_id and r.ad_client_id = f.ad_client_id)
join exp_formatline fl on (f.exp_format_id = fl.exp_format_id)
)
;
Tangent - Demonstration of Pack Out and Pack In to move Windows and Data
Note: this video show demonstrates moving both (1) moving windows from one system to another as well as (2) the data that resides in the window. The introduction makes you think it just performs #1.
Replication - Target Configuration - Discuss and Demonstrate
Import Processor
Import Processor Type
Replication - ReSync - When the Link Gets Broken
Replication - PostgreSQL to PostgreSQL Option
Replication - Viewing Messages
iDempiere uses "topic" messages to communicate between instances. Topic messages are not visible through the ActiveMQ admin interface. To see the actual messages, you can use one of the following techniques:
Turn iDempiere's logging to "finest" or "all" and process a message from either the source or target iDempiere instance. The message will be visible in the iDempiere log. Here are the instructions for setting log levels and viewing logs.
Use Hawt.io's tool to view the message. See the below video for instructions.