Informix

Informix

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Best way to synchronize tables via HTTPS

    Posted 04/19/23 03:28 AM

    Hello,

    we have a process requirements where we can´t directly reach customers informix DB via direct connection, so we need a process via HTTPS to synchronize some tables to our "master DB" on our side.
    What is the best way you can recommend? We would build a webservice for that. Can you recommend REST API for that?



    ------------------------------
    Marc Demhartner
    ------------------------------


  • 2.  RE: Best way to synchronize tables via HTTPS
    Best Answer

    Posted 04/19/23 04:01 AM

    Hi Marc,

    I'd say that's at least part of the REST API's purpose: translate REST calls into SQL towards the Informix server, and the result into JSON for the HTTP(S) client's consumption.
    Depending on what that synchronization involves, standard REST syntax might do; if not, there's also special REST syntax to allow direct infusion of arbitrary SQL.

    BR,
     Andreas



    ------------------------------
    Andreas Legner
    ------------------------------



  • 3.  RE: Best way to synchronize tables via HTTPS

    Posted 04/19/23 06:18 AM

    Marc:

    Andreas's point is that Informix is delivered with a REST protocol listener, you just have to start it up and you can interface with the instance directly using the REST API! You do not need any other REST product.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 4.  RE: Best way to synchronize tables via HTTPS

    Posted 04/20/23 03:13 AM

    Yes, thanks a lot - we will try it.
    Its included in all versions of Informix since 12.10FC3 ? 



    ------------------------------
    Marc Demhartner
    ------------------------------



  • 5.  RE: Best way to synchronize tables via HTTPS

    Posted 04/20/23 03:53 AM

    Don't actually remember when this got introduced.
    But I also wouldn't know of any wire (Mongo/REST) listener vs. IDS backend version dependencies, so you might well be able to pick the jsonListener.jar from a recent version and run it against an older server. It's only JDBC, after all.



    ------------------------------
    Andreas Legner
    ------------------------------



  • 6.  RE: Best way to synchronize tables via HTTPS

    Posted 04/20/23 08:07 AM

    Marc:

    I'm fairly certain that the REST listener feature extends back to 11.70, so, yes, it's in there.

    FWIW, 12.01.FC3 is a VERY old release. You really should upgrade to v14.10. It is likely that 12.10 will be going out-of-support in 2024 and you are missing many many bug fixes and performance improvements.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 7.  RE: Best way to synchronize tables via HTTPS

    Posted 04/20/23 11:17 AM
    You used to have to start multiple listeners depending on what you want to do.  Now it is just a single Jar file AFAIK so there might be some IDS version inter-dependencies.

    For most complex REST calls then the OneDB version is by far the better optiion, it should work happily against V14.x but is unlikely to be 'officially' supported.  Whether it is free or not .... No idea.

    As of the last time of asking, the Informix and OneDB wire listener/connector are not functional equivalent.

    Cheers
    Paul

    On 4/20/2023 7:06 AM, Art Kagel via IBM Community wrote:
    010001879e8f704e-0369e6ef-ce89-459c-96de-74575d5f5b79-000000@email.amazonses.com">
    Marc: I'm fairly certain that the REST listener feature extends back to 11.70, so, yes, it's in there. FWIW, 12.01.FC3 is a VERY old release....
    IBM Community

    Informix

    Post New Message
    Re: Best way to synchronize tables via HTTPS
    Reply to Group Reply to Sender
    Art Kagel
    Apr 20, 2023 8:07 AM
    Art Kagel

    Marc:

    I'm fairly certain that the REST listener feature extends back to 11.70, so, yes, it's in there.

    FWIW, 12.01.FC3 is a VERY old release. You really should upgrade to v14.10. It is likely that 12.10 will be going out-of-support in 2024 and you are missing many many bug fixes and performance improvements.

    Art



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------
      Reply to Group Online   View Thread   Recommend   Forward   Flag as Inappropriate  
    -------------------------------------------
    Original Message:
    Sent: Thu April 20, 2023 03:13 AM



     
    You are subscribed to "Informix" as paul@oninit.com. To change your subscriptions, go to My Subscriptions. To unsubscribe from this community discussion, go to Unsubscribe.





  • 8.  RE: Best way to synchronize tables via HTTPS

    Posted 04/21/23 08:59 AM
    Hi Marc,

    as you are explicitly asking about such an old version, I digged in my notes (which once existed as "The NoSQL Blog" in IBM's developerWorks - until IBM decided to demolish developerWorks). I found the following description. Therefore, I'm not very sure about 12.10.xC3, as I had used 12.10.xC4 for all my testing and examples ... Still, this probably gives you some ideas to get you started.

    ----------- excerpt from "The NoSQL Blog" ------------------
    As for the MongoDB API, the access via the REST API is also provided by a JSON Wire listener. The binary program is the same, ${INFORMIXDIR}/bin/jsonListener.jar, but the prerequisites and configuration for the REST API are different:
    • Prerequisites:
      • Java Runtime Environment (JRE):

        For the REST API the JSON Wire listener needs a JRE version 1.7 or newer. Unfortunately, this is not yet contained in version 12.10.xC4 of the Informix server. (It is present in version 12.10.xC5.) JRE version 1.6 that is present in Informix server 12.10.xC4 does not meet the requirements for the REST API. More information on the IBM JRE 1.7 and its download can be found for example on the following developerWorks page: http://www.ibm.com/developerworks/java/jdk/index.html.

      • Tomcat:
        The JSON Wire listener needs Tomcat version 8 or newer for the REST API. Tomcat version 8 is contained in the file ${INFORMIXDIR}/bin/nosql_sdk.zip that gets installed with the Informix server.

    • Configuration:

      The only difference in the configuration of the JSON Wire listener for the REST API as opposed for the MongoDB API is with the parameter "type": instead of "mongo" we supply the value "rest".

    In case it is not yet available on the system, a JRE version 1.7 (or newer) must be installed first. Depending on the platform and the JRE, the corresponding instructions are to be followed.

    For Tomcat we unpack the file ${INFORMIXDIR}/bin/nosql_sdk.zip so that its content gets stored in the directory ${INFORMIXDIR}/nosql_sdk.

    For the configuration we create a file named ${INFORMIXDIR}/etc/restListener.properties with the following content. Because we want to be able to use the MongoDB API and the REST API concurrently and independently from each other, we use a new port number, 26352 :

      listener.type=rest   listener.port=26352   security.sql.passthrough=true   url=jdbc:informix-sqli://localhost:24731/sysmaster:INFORMIXSERVER=mfu1;USER=informix;PASSWORD=informix 

    As before for the JSON Wire listener of the MongoDB API we create a start and a stop script. In these scripts we specify in the class path additional paths for the use of Tomcat. The complete files look as follows:

    • Start script rest_listener_start.sh :

        #!/bin/sh    ${INFORMIXDIR}/extend/krakatoa/jre/bin/java \   -cp ${INFORMIXDIR}/bin/jsonListener.jar:${INFORMIXDIR}/nosql_sdk/tomcat-embed-core.jar \    com.ibm.nosql.informix.server.ListenerCLI \   -config ${INFORMIXDIR}/etc/restListener.properties \   -logfile /work/martinfu/731/restListener.log \   -start &    exit   
    • Stop script rest_listener_stop.sh :

        #!/bin/sh    ${INFORMIXDIR}/extend/krakatoa/jre/bin/java \   -cp ${INFORMIXDIR}/bin/jsonListener.jar:${INFORMIXDIR}/nosql_sdk/tomcat-embed-core.jar \    com.ibm.nosql.informix.server.ListenerCLI \   -config ${INFORMIXDIR}/etc/restListener.properties \   -stop    exit   

    Finally, we start the JSON Wire listener for the REST API by running the start script as user informix.

    With that the service is ready and we can try to access the database via the REST API. As the protocol is HTTP we could use an internet browser, e.g. Firefox, and formulate the query as URL (better: as URI - Unified Resource Identifier) and send that to the JSON Wire listener. But to better see and understand what is happening, we use the Linux utility "cURL" instead of a browser. With this utility we send a URI to the addressed service, and the utility receives the answer and displays it as primitive text - all of this on the command line.

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


    Regards, Martin

    --

    Martin Fuerderer

    Software Engineer

    hcltechsw.com

    ::DISCLAIMER::

    The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.