App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#Applicationintegration
#App Connect
#AppConnect
 View Only
Expand all | Collapse all

Packaging message set and java project into bar in containerized environment.

  • 1.  Packaging message set and java project into bar in containerized environment.

    Posted Sun February 27, 2022 03:46 AM
    Dear All,

    We are running the ACE services on top of the openshift containerized platform. The services are pushed into git and Jenkins will do the deployment. With help of a Docker file, building an ACE image and running the container.

    Anybody can suggest how to create a bar for message set with docker file.

    I tried the below and its not working as expected.

    BBISO8583_0800MsgSetPrj is my message set.

    # Build bar ATM_NetworkManagementApp
    # ------------------------------
    RUN bash -c 'mqsipackagebar -w /home/aceuser/ -a /home/aceuser/bars/ATM_NetworkManagementApp.bar -k ATM_NetworkManagementApp -y BBISO8583_0800MsgSetPrj'

    #validate the bar. it is correctly build or not
    RUN bash -c 'mqsicreateworkdir /home/aceuser/ace-server && mqsibar -w /home/aceuser/ace-server -a /home/aceuser/bars/ATM_NetworkManagementApp.bar -c'
    # --------------------------------------------------------------


    Note : mqsicreatebar is not available in the ACE image to compile message set.


    Thanks,
    Anoop

    ------------------------------
    Anoop C Pillai
    ------------------------------


  • 2.  RE: Packaging message set and java project into bar in containerized environment.

    Posted Mon February 28, 2022 03:43 AM

    Hi Anoop

    You'll need to run mqsicreatebar to build message sets and java resources. The mqsicreatebar command will build/compile objects for deploy in a BAR file. The mqsipackagebar command will place deployable objects in a BAR file. If you don't have a "deployable" object, you'll need to create it first.

    mqsicreatebar is only available where you have a toolkit installation. So either build it in the pipeline somewhere where the toolkit is also installed (can be headless), or create the bar during development and add that one to git.

    An ibm example: https://community.ibm.com/community/user/integration/viewdocument/building-ci-cd-pipeline-for-ibm-app?CommunityKey=77544459-9fda-40da-ae0b-fc8c76f0ce18&tab=librarydocuments

    Or you can compile your resources first on a toolkit environment:
    mqsicreatebar -data workspace -compileOnly

    https://www.ibm.com/docs/en/integration-bus/9.0.0?topic=resources-compiling-mqsipackagebar-command




    ------------------------------
    Matthias Blomme
    ------------------------------



  • 3.  RE: Packaging message set and java project into bar in containerized environment.

    Posted Mon February 28, 2022 08:26 AM
    Hello,

     It looks like you're using ACE v12, and so the new ibmint command might do what you need. It is able to compile Java as well as message sets, including MRM message sets.

     I've thrown together a quick example at https://github.com/tdolby-at-uk-ibm-com/ace-mrm-compile-example to illustrate how to use the command (developed on Linux and verified on Windows). It looks like you could replace both of your commands with a single ibmint deploy as shown in that repo.

     Would be good to hear if it works, or what happened if it doesn't work.


  • 4.  RE: Packaging message set and java project into bar in containerized environment.

    Posted Tue March 01, 2022 02:48 AM
    Hi,

    In ACE 12 only msets have to be compiled with ibmint and contrary to mqsicreatebar you can do this for each mset project separately (much quicker than mqsicreatebar for a whole workspace). If you package a bar file with ibmint the jar will be created as well, no need for separate compile.

    ------------------------------
    Regards,
    Jan Fluitsma
    ------------------------------



  • 5.  RE: Packaging message set and java project into bar in containerized environment.

    Posted Tue March 01, 2022 04:34 AM
    Hi Trevor

    Your demo works like a charm. I didn't really look into ibmint before, but now I am a believer.
    Only thing that is a bit of a shame (but also understandable) is that if you run ibmint deploy a bar file is created in the background and deleted afterwards. So even though it combines everything you need, you are missing a resulting bar file.
    You'd probably end up doing ibmint compile msgset and ibmint package anyway.

    Regards



    ------------------------------
    Matthias Blomme
    ------------------------------



  • 6.  RE: Packaging message set and java project into bar in containerized environment.

    Posted Tue September 27, 2022 10:10 AM
    We've been having issues with the `ibmint` command, in the sense it doesn't "see" all the packaged java classes and fails to compile them in the `ibmint package` command.

    Our project is setup is as follows:

    Application A
    - Resources:
      - Java: JavaProjectA
    [meaning app A has JavaProjectA as a managed project]

    Within the JavaProjectA we have a jar file added [and is set as such in the build path]. Classes within JavaProjectA are able to import and use classes from the jar file. No issues are reported by the toolkit and it helps with auto-completion and similar assistance.

    Within Application A, we use java compute nodes that reference our classes from JavaProjectA [again, no errors in the toolkit], as well as mapping files that use java custom transformation.

    Attempts to package give a limited error:

    λ ibmint package --input-path ./ApplicationA --output-bar-file ../a.bar
    BIP8409I: Compiling Java project 'c:\Projects\ace\ApplicationA\JavaProjectA'
    c:\Projects\ace\ApplicationA\JavaProjectA\gen\MyInternalApi.java:3: error: package x.y.z.config does not exist
    import x.y.z.config.ConfigureRestApicCall;​
                        ^


    If we use the `ibmint package` with the `--do-not-compile-java` it works, however the final package lacks the required java classes from JavaProjectA.
    The same project setup works without issues in the old platform [IIB, using `mqsicreatebar` command].

    ------------------------------
    Vid Romac
    ------------------------------



  • 7.  RE: Packaging message set and java project into bar in containerized environment.

    Posted Wed September 28, 2022 01:55 AM
    Hi Vid

    Have you tried adding that jar file to the shared-classes directory?


    ------------------------------
    Regards
    Matthias Blomme
    ------------------------------



  • 8.  RE: Packaging message set and java project into bar in containerized environment.

    Posted Wed September 28, 2022 03:30 AM
    We haven't attempted that, as our goal was to package it within the BAR file, to be self-serving/independent, containing all that it requires without depending on external shared classes. As I understand it, the suggested solution is to put the jar in a directory, within the runtime machine [and use the `--do-not-compile-java` while packaging to skip the original error?]. Does such an approach even work for a container env? [see https://github.com/ot4i/ace-docker/issues/27]

    Just to be clear, the original approach of using `ibmint` to properly compile the described project is NOT supported?

    ------------------------------
    Vid Romac
    ------------------------------



  • 9.  RE: Packaging message set and java project into bar in containerized environment.

    Posted Wed September 28, 2022 03:36 AM
    Vid, Can you try this again with 12.0.6.0? I am assuming you were using an earlier version of the product. 12.0.6.0 has some relevant fixes.

    ------------------------------
    Geza Geleji
    ------------------------------



  • 10.  RE: Packaging message set and java project into bar in containerized environment.

    Posted Wed September 28, 2022 04:41 AM
    Didn't even notice a new version was available :O [we were using 12.0.5.0, and v6 came out yesterday!]

    We tried it with 12.0.6.0 and it worked as expected!

    Thank you!

    [also, this is a first - to encounter an issue and get an official fix the very next day]

    ------------------------------
    Vid Romac
    ------------------------------