OGG for java: how to use the token in a velocity model


Hello community,

I need help to solve my problem.

I have an extraction process that extract data from a table only on the insert.

I want to insert this information in a jms queue. but I need more information to reproduce, so I use sqlexec and tojken to store the information in the file exttrail.

I use an extract data pump to read data from the exttrail file and place it in a jms queue using a velocity template.

My question is: how to read "user fees" in a model of speed?

Thanks in advance for your help

Concerning

JMBien

Following extracted files and model speed

-----------------------------------------------------------------------------------------------------------

X_FR2FRH

SUCH X_FR2FRH

SOURCEDB SFRH


EXTTRAIL O:\GoldenGate\OGG_FRH\LT_FRH\FR2\FR
TRANLOGOPTIONS MANAGESECONDARYTRUNCATIONPOINT

GETREPLICATES

--H
TABLE "dbo." " HISTO_STATUT_WKF_MSG', COLSEXCEPT (_Timestamp),
SQLEXEC (ID performance(1), QUERY "select CrMsgId, OrdrReleaseDtTm from cmc, HISTO_STATUT_WKF_MSG hswm CORE_MSG_COMPL where hswm.") IdHistoStatutWkfMsg =? and cmc. CrMsgId = hswm. IdMsg and IdTypeWkf = 3 and IdStatutWkf = 1 ", &
PARAMS (p1 = IdHistoStatutWkfMsg)), and
CHIPS (ORDRRELEASEDT = @GETVAL (performance(1). OrdrReleaseDtTm), CRMSGID = @GETVAL (performance(1). CrMsgId)));

--------------------------------------------------------------------------------------------------------------------------------------------------------------

PFR2RJMS :

EXTRACT PFR2RJMS
SOURCEDB SFRH

SETENV (GGS_USEREXIT_CONF = "dirprm/PFR2RJMS.properties")
SETENV (GGS_JAVAUSEREXIT_CONF = "dirprm/PFR2RJMS.properties")


CUSEREXIT dirprm/ggjava_ue.dll CUSEREXIT-PASSTHRU - INCLUDEUPDATEBEFORES

-getupdatebefores


getInserts

--H
TABLE dbo. HISTO_STATUT_WKF_MSG;

GET_USER_TOKEN_VALUE (OrdrReleaseDtTm, 8);

ignoreinserts

-------------------------------------------------------------------------------------------------------------------------

Velocity model :

# (This is a comment) if in "operating mode, then you can remove the outer loop,
# and have only a 'foreach' iterate over the columns in the operation.
##
< numOps transaction =' ${tx. Size}' ts =' ${tx. Timestamp} ">"
#foreach ($op in $tx)
< action type = "${op.» SqlType}"table =" ${op. " TableName} ">"
#foreach ($col in the $op)
< column name = "${col." OriginalName}"index =" ${col. " Index}", isKey =" ${col.meta.keyCol} ">
< after >$ {col. AfterValue} < / after >
< / column >
#end
< / operation >
#end
< / transaction >

jmbien wrote:

...

I have an extraction process that extract data from a table only on the insert.

I want to insert this information in a jms queue. but I need more information to reproduce, so I use sqlexec and tojken to store the information in the file exttrail.

...

My question is: how to read "user fees" in a model of speed?

X_FR2FRH

...

TABLE "dbo." " HISTO_STATUT_WKF_MSG', COLSEXCEPT (_Timestamp),

SQLEXEC (ID performance(1), QUERY "select CrMsgId, OrdrReleaseDtTm from cmc, HISTO_STATUT_WKF_MSG hswm CORE_MSG_COMPL where hswm.") IdHistoStatutWkfMsg =? and cmc. CrMsgId = hswm. IdMsg and IdTypeWkf = 3 and IdStatutWkf = 1 ", &
PARAMS (p1 = IdHistoStatutWkfMsg)), &
CHIPS (ORDRRELEASEDT = @GETVAL (performance(1). OrdrReleaseDtTm), CRMSGID = @GETVAL (performance(1). CrMsgId)));

--------------------------------------------------------------------------------------------------------------------------------------------------------------

PFR2RJMS:

EXTRACT PFR2RJMS

SOURCEDB SFRH

SETENV (GGS_USEREXIT_CONF = "dirprm/PFR2RJMS.properties")
SETENV (GGS_JAVAUSEREXIT_CONF = "dirprm/PFR2RJMS.properties")

CUSEREXIT dirprm/ggjava_ue.dll CUSEREXIT-PASSTHRU - INCLUDEUPDATEBEFORES

-getupdatebefores

getInserts

--H
TABLE dbo. HISTO_STATUT_WKF_MSG;

GET_USER_TOKEN_VALUE (OrdrReleaseDtTm, 8);

ignoreinserts

-------------------------------------------------------------------------------------------------------------------------

Velocity model:

#foreach ($op in $tx)
 
#foreach ($col in the $op)
   
    ${col. AfterValue}
   

#end
 

#end

In the excerpt from the source, you have two chips, ORDRRELEASEDT, and CRMSGID.  On each operation on the dbo. HISTO_STATUT_WKF_MSG, these chips will be defined.  (Other tables will not have these value tokens.) To use the chips in the model, use $op.getToken ("ORDRRELEASEDT") and $op.getToken ("CRMSGID"). Similarly for the "getenv" values defined by GG, $op.getEnv ("GGENVIRONMENT", "GROUPNAME")

In both cases, you can first check if the value is set, ${op.isEnvSet ("GGENVIRONMENT", "the GROUPDESCRIPTION")}, or ${op.getToken("ORDRRELEASEDT").isSet ()}; for example,.

      token value: (is set? '${op.getToken("MY_TOKEN").isSet()}'): MY_TOKEN= #{if}($op.getToken("MY_TOKEN").isSet()) '$op.getToken("MY_TOKEN")' #{else} (not set) #{end}

There is one caveat, however: process GoldenGate trail of data as a continuous stream, a single operation (insert, update, delete) at the same time. The only way that the GG Java adapter can "loop" on the operations in a transaction is by buffering all memory operations and then loop over them at the end (Alternatively, you can write a formatter Java custom which formats the data happens, each operation individually, and not stamp anything; but that cannot be done in speed (, assuming that you do not want to set txn as a msg JMS, rather than individual operations, sent as JMS messages.)

In general, there are two ways to format data trail in JMS messages: an operation per message, or of a message transaction.  Using a txn/msg may seem simple, but imagine if you have a few jobs in bulk on the DB which transforms 100 millions of rows in a table in a single txn; Then, your message JMS maybe 100 MB (or several GB) in size (there is no way to know in advance). The GG JMS client might be able to send the msg (given enough memory), but it will probably lower the JMS server, or JMS clients consume the (huge) message.

But back to what tokens: If you loop on operations in memory swabbed and make a call to "getEnv" or "getToken", these are in fact reminders of NYI "extract" and will retrieve the value of getenv/token for the current operation - that is to say, the last operation as part of the operation - which is probably not what you want.  The solution is to format each operation individually - you can do this automatically using Velocity templates if sending a msg by operation; otherwise, you will need to write a custom Java trainer that formats the message that each operation is received (not at the end of the tx), and you can still run the WAD Manager "tx" mode (i.e., sending a tx by msg) If you want.

Other smaller points:

  • If you use GG 11.2 adapter, then you need not of the «setenv (...)» Properties); If you extracted 'foo', while it loads of 'foo.properties' from the directory dirprm automatically.
  • GET_USER_TOKEN_VALUE is not used in the file of the prm. It's a value C user-output API callback (i.e., only used if C user-output (in C) coding).  (I'm surprised that the prm file that allows here.)
  • You can delete the 'getInserts' and 'ignoreInserts', because even once which is not used in this case.  Changes/insertions/deletions are always "obtained".
  • You may need to spend in all inserts/modifications/deletions (including 'before' values) to exit user Java so that the limits of tx be properly processed; This was necessary before 11.2 Java adapter, and IIR there is a bug that prevented these filters work as expected in earlier versions of 11.2.  Alternatively, you can write filters in Java, by adding them to the file property: gg.handler.my_handler.filter = com.example.custom.MyEventFilter (where MyEventFilter implements com.goldengate.atg.datasource.DsEventFilter)

It will be useful,

-Mike

Tags: Business Intelligence

Similar Questions

  • How to use the: token of $ $PROFILE in a game of validation of table values

    Hello community,

    Let me explain the scenario.

    We have a set value (CLIENTS SERVICIO DIRECTO) Flex with a validation of the table included in the PO headers FDF, which shows a LOV with the recipient addressfrom the customer we want to serve the goods; that is, we act as a commisionists and the provider makes the goods to the customer's shipping address.

    This Flex value, as I said, have a table, with the following table of validation validation:

    Application of the table: Oracle receivables
    Table name: RA_ADDRESSES_ALL a, RA_CUSTOMERS b

    Table Columnns: b.CUSTOMER_NAME Varchar2 (20), a.PARTY_LOCATION_ID Varchar2 (20)

    Where / Order By: a.CUSTOMER_ID = b.CUSTOMER_ID

    Additional columns: a.ADDRESS1 "address" (20), a.CITY Ciudad "(10) «»

    If we translate this to a SQL code:

    Select a.address1,
    a.City,
    a.party_location_id,
    b.Customer_name
    ra_addresses_all a.,
    ra_customers b
    where a.customer_id = b.customer_id
    and b.customer_id = 6283 <-this last condition clause is intended to reduce the result to the interested customer.

    This select recover we two records; for the same customer, one of them for an organization_id (say 85) and one of them for the other organization_id (84).

    What are looking for us, and want to, it's that the LOV, which actually display two records, only shows the recipient site to the client that belongs to the organization_id that belongs to the user who questioned or creates the purchase order.

    That is, suppose that we enter in Purchasing using the who have been assigned to the business unit or Organization_id 84. We want this theLOV to show that the recipient Site to the client that belongs to the business unit or Organization_id 84.

    I believe that we can achieve this by using the: token of $ $PROFILE, but we do not know how.

    Any ideas?

    Thanks a lot for your answer.

    I think that we can use elsewhere as fnd_profile.value ('profile_name') (?)

    Kind regards.

  • Any suggestions how I use the eprint with an older model HP J4580 all-in-One?

    Help!

    Thank you

    Jean

    Hi, RBDM.

    EPrint (printing by sending an email to the printer) service will not work with older printers.  You want to be able to do?  Print from a mobile device?  Print remotely?

  • How to use the ESD document with structured templates

    Hello

    I started to learn working with SEDD. I have an existing ESD, now I'm suppose to use it to create documents. I created a new book and imported this ESD file to it. I can see all the items in the catalog of the element. But when I start to add items to the book and add a new document, the elements are turning to red. Referring to the User Guide, it is said EDD cannot be used directly and must be used with structured patterns. But I do not have these models structured with me. Can someone please tell me how to create these structured templates and how to use the ESD file with these models, and out of this problem.

    Thanks in advance.

    Although ESD exist in the form of a separate document, the only way that it can be used is when it is part of the model. As a model of structured FrameMaker, a structured model contains master pages, pages reference, character formats, paragraph formats, etc. IN ADDITION, a structured model contains a DSP. To add the EDD to your template file, or any document FrameMaker who will use it, open the template file and the file of ESD. Click anywhere in the template file, and then select file > import > element definitions. In the dialog box, select the EDD file as source and click Import. Then save the template file.

    To use the template file, open it and save it as a FrameMaker document, giving it the name you want. You can now create your structure.

    If you use a book, all documents in the book must use the same ESD. Open the template file. In the book file, select all the documents in the book. Then select file > import > element definitions. In the dialog box, select the template file and click Import. Once completed, all documents in the book have the same ESD. In addition, ESD is copied into the file of the book itself.

    You say:

    But when I start to add items to the book and add a new document, the elements are turning to red.

    It is is not clear to me what you do. While it is true that SOME elements of a book are in the book file, you cannot add a book of items in the folder (at least not as far as I know). In general, the book file, it encapsulates elements around the documents root elements in the book. You may need to update the book to get a part of the Red disappear lines. You may need to rearrange items in the structure of the book to remove the red lines.

    Hope this helps,

    Van

  • How to use the same services-config for servers the and remote.

    My flex project works very well using the bottom but when I download my flash on the server I do not work, all the files and related paths are the same execpt remote is a linux server.

    <? XML version = "1.0" encoding = "UTF-8"? >
    <>services-config
    < services >
    < id = 'amfphp-flashremoting-service' service
    Class = "Flex.Messaging.services.RemotingService"
    messageTypes = "flex.messaging.messages.RemotingMessage' >"

    < destination id = "amfphp" >
    <>channels
    < Ref channel = "my-amfphp" / >
    < / channels >
    Properties of <>
    < source > * < / source >
    < / properties >
    < / destination >
    < / service >
    < / services >
    <>channels
    < channel-definition id = "my-amfphp" class = "mx.messaging.channels.AMFChannel" >
    " < endpoint uri = ' http://localhost/domainn.org/AMFPHP/gateway.php "class="flex.messaging.endpoints.AMFEndpoint"/ > "
    < / channel-definition >
    < / channels >
    < / services-config >

    I think the problem is the line


    " < endpoint uri = ' http://localhost/domainn.org/AMFPHP/gateway.php "class="flex.messaging.endpoints.AMFEndpoint"/ > "

    but I don't know how to use the same services-config for servers the and remote.

    I'll back up a bit.

    Breakpoint URLS are defined as follows in the services - config.xml:

    https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure

    The meaning of each of the tokens is clearer when we see them as part of a complete url. If your context root is set to http://localhost , then I have no idea how your application runs in any environment.

    If you leave the server.name and server.port chips in your configuration file, then they will be replaced when executing according to the location from which your application is served. However, the context.root token is replaced at the time of the compilation based on the value that you specify in Flex Builder or when calling mxmlc.

    In order to reuse your file services - config.xml, you must use the same context-root on your development environment and to your deployment environment.

  • How to use the utility disk first aid for hard drive internal el captian

    How to use the utility disk first aid for hard drive internal el captian

    Select the drive and click first aid.

    If something is not repairable because this is the system drive, then you need to start using the recovery partition and run disk utility it.

  • I just installed an SSD on my imac 24 inch 2007 but at the start of the computer does not see the drive. How to use the terminal to look for? Thank you

    I just installed an SSD on my imac 24 inch 2007 but at the start of the computer does not see the drive. How to use the terminal to look for? Thank you

    Can she be seen by disk utility (and which version of Mac OS X is)

  • Is there an online class to learn exactly how to use the command prompt which is quite through. OR y at - it clear a book that explains in detail for this? Who should I contact?

    I would like to know how to use the command prompt.  The nethodology type in the cmd prompt with the syntax and the Liposuction, in other words, the real return to a command prompt. I downloaded about evertthing I can find about this, but can't seem to put it all.

    My OS is Windows XP Pro sp3, lots of RAM, my address is * address email is removed from the privacy *.   I would like to take a rough online study if one is available if it is not too expensive.

    It really depends on what you mean by "to a command prompt."

    If you open a command prompt window (for example, in start > run > cmd > OK), you can enter a number of orders.  The list of available commands, including their syntax, is here--> http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true

    You can also follow the links here:http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_o.mspx

    If you want to get more sophisticated - automating command-line tasks - you can start here: http://technet.microsoft.com/en-us/scriptcenter/default.aspx

  • Error message: your browser must have Java enabled to use the Client for Java when you try to access the Citrix server.

    Original title: java question.

    I'm trying to access the Citrix server to access my work server.  When I click on an application, I get an error message: your browser must have Java enabled to use the Client for Java.  I checked and the right version of Java installed and removed the old Java applications but still this message when trying to access Citrix.  Please meet w / directions for a fix.

    Start by seeing if Java has been installed correctly:

    http://www.Java.com/en/download/testjava.jsp

    or
    http://javatester.org/

  • Any how to use the Cloud for business training

    As in the topic I'm looking for inspiration, examples, how to use the Cloud for his work.

    My organization is a training, coaching and HR solutions company. (If you are interesting in, welcome to [deleted by Moderator])

    I believe that such tools as a Cloud technology could training more effective and more attractive to the user in its form.

    Will be grateful for any suggestion

    Wik

    Hello

    Please see the pricing and membership creative cloud plans | Adobe Creative Cloud

    You can also attach sales to understand plans and benefits.

    Contact us | Adobe

    Hope that helps!

    Kind regards

    Sheena

  • I have a purchased copy of PhotoShop Elements 9.  When I run it now I get an error message - error: 213:19.  What does that mean?  How to use the software I paid?  Thanks a lot for your help!

    I have a purchased copy of PhotoShop Elements 9.  When I run it now I get an error message - error: 213:19.  What does that mean?  How to use the software I paid?  Thanks a lot for your help!

    See here:

    In Photoshop Elements license error

  • I can't find a newer version of adobe flash player for ubuntu 14.04, I tried to use the apt version but it wouldn't work and I don't know how to use the tar.gz files and install, I think the current version to .deb

    I can't find a newer version of adobe flash player for ubuntu 14.04, I tried to use the apt version but it wouldn't work and I don't know how to use the tar.gz files and install, I think the current version to .deb

    Hi LF12,.

    The latest version of Flash Player for Linux is 11.2.202.400.  The current versions of Flash Player are displayed here http://www.adobe.com/software/flash/about/. The versions on the page are updated with each new version.

    --

    Maria

  • How to use the sign ' # ' in jQuery for id?

    How to use the sign ' # ' in jQuery for id? When I try to use it as ($('#PropertyAttributeValue').css ('color', 'red') ;) I got error as follows:)

    The CFML compiler treated:

    • An expression that starts at line 64, column 37.
      The expression might be missing an end #, for example, #expr instead of #expr #.
    • The body of a beginning of tag cfoutput on line 19, column 18.

    Use the two hashes to escape the first:

    ($('##PropertyAttributeValue').css ('color', 'red') ;))

  • How to use the function @RETURN for poster messages Essbase in 11.1.2.1

    Hello

    I found the business support Essbase Hyperion Planning 11.1.2.1 @RETURN rule novelty.

    If I create a simple BR for planning app like below:
    "@RETURN ("test return message,"WARNING);
    Validation returns error and BR can not be deployed.

    One is how to use the function @RETURN br?

    Thank you!

    He probably should be in a calco for example block

    "Profit".
    (
    ....
    )

    It is more likely to be used with an IF ELSE command, you do not want to define the condition for the calculation, roughly what the feature is designed for output.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to use the copy utility for app from one server to another

    Hello
    I use hyperion 9.3.1 and I want to synchronize two applications on different server, I know how to use the utility to copy of app, but on the same server, I think that we can also use this utility to copy the application from one server to another using the properties file but I dnt know how to do it because the example is SQL and I am using and database oracle
    can you guys please help.

    Published by: sharad sapra on March 31, 2011 11:33

    Hello

    1. create a property file (this example is relevant if you have a repository of ORACLE, you can find more information in http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/html_hp_admin/frameset.htm?ch09s01s01.html]):

    SOURCE_APP_JDBC_CATALOG = SOURCE_APP
    SOURCE_APP_JDBC_DRIVER = Hyperion.JDBC.Oracle.OracleDriver
    SOURCE_APP_JDBC_URL = jdbc:hyperion:oracle://RepositoryDatabaseServer; SID = DatabaseSID
    SOURCE_APP_JDBC_USERNAME = schemaName
    SOURCE_APP_JDBC_PASSWORD = schemaPassword
    SOURCE_APP_JDBC_DATABASE_TYPE = ORA
    SOURCE_APP_OLAP_SERVER = olapServerName:port
    SOURCE_APP_OLAP_USERNAME = olapUserName
    SOURCE_APP_OLAP_PASSWORD = olapUserPassword
    SOURCE_APP_OLAP_APPNAME = SOURCE_APP

    TARGET_APP_JDBC_CATALOG = TARGET_APP
    TARGET_APP_JDBC_DRIVER = Hyperion.JDBC.Oracle.OracleDriver
    TARGET_APP_JDBC_URL = jdbc:hyperion:oracle://RepositoryDatabaseServer; SID = DatabaseSID
    TARGET_APP_JDBC_USERNAME = DatabaseSchemaName
    TARGET_APP_JDBC_PASSWORD = DatabaseSchemaPassword
    TARGET_APP_JDBC_DATABASE_TYPE = ORA
    TARGET_APP_OLAP_SERVER = olapServerName:port
    TARGET_APP_OLAP_USERNAME = olapUserName
    TARGET_APP_OLAP_PASSWORD = olapUserPassword
    TARGET_APP_OLAP_APPNAME = TARGET_APP

    2. open CMD and type copyapp /S:yourSourceAppName T:yourTargetAppName P:yourPropertiesFileName.properties /L:yourLogFileName.log

    Once the migration has been successful, you must update your users using the UpdateUsers.cmd (UpdateUsers.cmd and PlanningUserName PlanningUserPassword TARGET_APP).

    I hope this helps...

    Kind regards
    André

Maybe you are looking for

  • Keychain Access: safari autofill metadata credit card

    In Keychain Access/Local Items/passwords there are a large number of elements called Safari Autofill Metadata credit. Type = application password Where = SafariNeverSavedCreditCardNumberSuffixes What exactly are these and what is the advantage to kee

  • Stopping the engine Service Variable OR in Windows 7 64 bit

    Operating system: Windows 7 (64-bit) Version 9 of Labivew. I configured puts some Boolean and Out entries and an analog input (Double) for monitoring purposes. I use a server OPC Mitsubishi with Labview 2009. (It worked great for over a year) When I

  • How can I save a word doc edited (using skydrive) in hotmail when I'm done?

    I don't have Word installed on my computer.  I got a word doc that had to be edited, so I used Skydrive.  Simple enough, but nowI have no idea how to save him (I tried to save on the desktop using the HTML format) is the right way?  Then tie in Hotma

  • \WINDOWS\SYSTEM32\CONFIG\SYSTEM is missing or damaged

    I got a message saying that windows does not start because the following file is missing or damaged: wystem, config, system, windows.  I have long lost my windows installation cd, but I have the key code of the product than the original installers pl

  • How do I reinstall Windows 7

    I have Samsung mobile RF711 with pre-installed Windows 7 Home Prem OA. Widows does not start even in safe mode so I need to reinstall but don't know how, since when I go to https://www.microsoft.com/en-gb/software-download/windows7 and enter my produ