IBM Sterling B2B: Configuring SB2Bi to use S3 Storage Provider: Difference between revisions

From Wiki
No edit summary
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:


 
== Configure AWS SDK for Java on SB2Bi ==


1) Download AWS SDK for Java from this location https://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip and unzip file.
1) Download AWS SDK for Java from this location https://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip and unzip file.
Line 6: Line 6:
  cd /tmp
  cd /tmp
   
   
  wget https://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip
  wget <nowiki>https://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip</nowiki>
   
   
  unzip aws-java-sdk.zip
  unzip aws-java-sdk.zip
cd /opt/IBM/SterlingIntegrator/bin


2) Stop Sterling B2B Integrator
2) Stop Sterling B2B Integrator


cd /opt/IBM/SterlingIntegrator/bin
  ./softStop.sh -all
  ./softStop.sh -all
   
   
Line 24: Line 24:
4) Import third party libraries
4) Import third party libraries


Now we need to import third party libraries from directory
Now we need to import third party libraries (httpclient-[ver].jar,httpcore-[ver].jar, jackson-annotations-[ver].jar, joda-time-[ver].jar) from directory


  /tmp/aws-java-sdk-1.12.565/third-party/lib/  
  /tmp/aws-java-sdk-1.12.565/third-party/lib/  


but is important to make sure that in '''<si_install_dir>/properties/dynamicclasspath.cfg''' and '''dynamicclasspath.cfg.in''', there are no duplicates (like httpclient.jar).
but is important to make sure that in '''<si_install_dir>/properties/dynamicclasspath.cfg''' and '''dynamicclasspath.cfg.in''', there are no duplicates (like httpclient.jar) and with a higher version.


in my case SB2Bi 6.2 and aws-java-sdk-1.12.565, in need to
in my case SB2Bi 6.2 and aws-java-sdk-1.12.565, in need to
Line 59: Line 59:
  ./run.sh
  ./run.sh


= Deploying MinIO (S3 storage) =
MinIO is not listed as supported by SB2Bi, but for testing and validation purposes will be excelent.
1) The fastest way to have MinIO: [[MinIO: Deploy MinIO as Container]]
'''Important''':
* S3 Protocol Port: 9000
* MinIO console Port: 9001
2) Access MinIO console Sample: '''<nowiki>http://10.1.1.1:9001/login</nowiki>'''. To login provide the variables from podman command:
-e "MINIO_ROOT_USER=root" \
-e "MINIO_ROOT_PASSWORD=passw0rd" \
3) Create a bucket. Sample: '''mysfg-bucket-minio'''
4) Create an access token. See here [[MinIO]]
5) upload a file to test. Example: '''arquivo_teste2.txt'''
[[File:MinioInterface.png]]
= Create a BP to get a file in MinIO (S3 storage)=
<process name="Demo_MinioS3ClientGet">
  <sequence>
    <operation name="AWSS3 Get Service">
      <participant name='AWSS3Client'/>
      <output message='xout'>
        <assign to='action'>get</assign>
        <assign to="awss3.endpoint">'''<nowiki>http://10.1.1.1:9000</nowiki>'''</assign>
        <assign to="awss3.bucketname">'''mysfg-bucket-minio'''</assign>
        <assign to="awss3.filename">'''arquivo_teste2.txt'''</assign>
        <assign to="awss3.accesskey">'''VQ..rA'''</assign>
        <assign to="awss3.secretkey">'''K4..ge'''</assign>
        <assign to="requiredProxy">false</assign>
        <assign to="useOrigFileName">true</assign>
        <assign to='.' from='PrimaryDocument' />
      </output>
      <input message="xin">
        <assign to="." from="*"/>
      </input>
    </operation>
  </sequence>
</process>
Other examples you can see here [https://www.ibm.com/docs/en/b2b-integrator/6.2.0?topic=l-amazon-web-service-simple-storage-service Amazon Web Service Simple Storage Service]
= Configure Sterling File Gateway to store files in MinIO (S3 storage)=
1) Generate '''Obscured Access Key''' and '''Obscured Secret Key'''
In the fields '''Obscured Access Key''' and '''Obscured Secret Key''', you must enter the obscure key.
So you need to run the obscure command
/opt/IBM/SterlingIntegrator/bin/obscure_passphrase.sh <keys>
2) The EndPointURL
Our minio server is not configured with https, so in the enpoint field I will provide the protocol/address/port.
3) Create a Partner and setup configuration for S3
'''Important 1''': In the fields '''Obscured Access Key''' and '''Obscured Secret Key''', you must enter the obscure key.
So you need to run the obscure command
/opt/IBM/SterlingIntegrator/bin/obscure_passphrase.sh <keys>
Get the output and fill in that fields
My example:
[[File:Sfg-s3-partner.png]]
2) Create a Routing Channel
[[File:Sfg-s3-rct.png]]
3) Create a Channel
[[File:Sfg-s3-channel.png]]


= Ver também =
= Ver também =
Line 67: Line 152:
[[Category:File Gateway]]
[[Category:File Gateway]]
[[Category:SFG]]
[[Category:SFG]]
[[Category: MinIO]]
[[Category: S3]]

Latest revision as of 22:47, 25 February 2024

Configure AWS SDK for Java on SB2Bi

1) Download AWS SDK for Java from this location https://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip and unzip file.

cd /tmp

wget https://sdk-for-java.amazonwebservices.com/latest/aws-java-sdk.zip

unzip aws-java-sdk.zip

2) Stop Sterling B2B Integrator

cd /opt/IBM/SterlingIntegrator/bin 

./softStop.sh -all

./hardStop.sh

3) Install aws-java-sdk-[version].jar

./install3rdParty.sh awssdk 1.12.565 -j /tmp/aws-java-sdk-1.12.565/lib/aws-java-sdk-1.12.565.jar

4) Import third party libraries

Now we need to import third party libraries (httpclient-[ver].jar,httpcore-[ver].jar, jackson-annotations-[ver].jar, joda-time-[ver].jar) from directory

/tmp/aws-java-sdk-1.12.565/third-party/lib/ 

but is important to make sure that in <si_install_dir>/properties/dynamicclasspath.cfg and dynamicclasspath.cfg.in, there are no duplicates (like httpclient.jar) and with a higher version.

in my case SB2Bi 6.2 and aws-java-sdk-1.12.565, in need to

./install3rdParty.sh awssdk 1.12.565 -j /tmp/aws-java-sdk-1.12.565/third-party/lib/netty-codec-http-4.1.94.Final.jar
./install3rdParty.sh awssdk 1.12.565 -j /tmp/aws-java-sdk-1.12.565/third-party/lib/netty-common-4.1.94.Final.jar
./install3rdParty.sh awssdk 1.12.565 -j /tmp/aws-java-sdk-1.12.565/third-party/lib/netty-buffer-4.1.94.Final.jar
./install3rdParty.sh awssdk 1.12.565 -j /tmp/aws-java-sdk-1.12.565/third-party/lib/netty-transport-4.1.94.Final.jar
./install3rdParty.sh awssdk 1.12.565 -j /tmp/aws-java-sdk-1.12.565/third-party/lib/netty-resolver-4.1.94.Final.jar
./install3rdParty.sh awssdk 1.12.565 -j /tmp/aws-java-sdk-1.12.565/third-party/lib/netty-codec-4.1.94.Final.jar
./install3rdParty.sh awssdk 1.12.565 -j /tmp/aws-java-sdk-1.12.565/third-party/lib/netty-handler-4.1.94.Final.jar
./install3rdParty.sh awssdk 1.12.565 -j /tmp/aws-java-sdk-1.12.565/third-party/lib/netty-transport-native-unix-common-4.1.94.Final.jar

so my dynamicclasspath.cfg looked like this:

...
VENDOR_JAR=/opt/IBM/SterlingIntegrator/jar/awssdk/1.12.565/aws-java-sdk-1.12.565.jar
VENDOR_JAR=/opt/IBM/SterlingIntegrator/jar/awssdk/1.12.565/netty-buffer-4.1.94.Final.jar
VENDOR_JAR=/opt/IBM/SterlingIntegrator/jar/awssdk/1.12.565/netty-transport-4.1.94.Final.jar
VENDOR_JAR=/opt/IBM/SterlingIntegrator/jar/awssdk/1.12.565/netty-resolver-4.1.94.Final.jar
VENDOR_JAR=/opt/IBM/SterlingIntegrator/jar/awssdk/1.12.565/netty-codec-4.1.94.Final.jar
VENDOR_JAR=/opt/IBM/SterlingIntegrator/jar/awssdk/1.12.565/netty-handler-4.1.94.Final.jar
VENDOR_JAR=/opt/IBM/SterlingIntegrator/jar/awssdk/1.12.565/netty-transport-native-unix-common-4.1.94.Final.jar
VENDOR_JAR=/opt/IBM/SterlingIntegrator/jar/awssdk/1.12.565/netty-codec-http-4.1.94.Final.jar

5) Run setupfiles and Start Sterling B2B Integrator

./setupfiles.sh

./run.sh

Deploying MinIO (S3 storage)

MinIO is not listed as supported by SB2Bi, but for testing and validation purposes will be excelent.

1) The fastest way to have MinIO: MinIO: Deploy MinIO as Container

Important:

  • S3 Protocol Port: 9000
  • MinIO console Port: 9001

2) Access MinIO console Sample: http://10.1.1.1:9001/login. To login provide the variables from podman command:

-e "MINIO_ROOT_USER=root" \
-e "MINIO_ROOT_PASSWORD=passw0rd" \

3) Create a bucket. Sample: mysfg-bucket-minio

4) Create an access token. See here MinIO

5) upload a file to test. Example: arquivo_teste2.txt

Create a BP to get a file in MinIO (S3 storage)

<process name="Demo_MinioS3ClientGet">
 <sequence>
   <operation name="AWSS3 Get Service">
     <participant name='AWSS3Client'/>
     <output message='xout'>
       <assign to='action'>get</assign>
       <assign to="awss3.endpoint">http://10.1.1.1:9000</assign>
       <assign to="awss3.bucketname">mysfg-bucket-minio</assign>
       <assign to="awss3.filename">arquivo_teste2.txt</assign>
       <assign to="awss3.accesskey">VQ..rA</assign>
       <assign to="awss3.secretkey">K4..ge</assign>
       <assign to="requiredProxy">false</assign>
       <assign to="useOrigFileName">true</assign>
       <assign to='.' from='PrimaryDocument' />
     </output>
     <input message="xin">
       <assign to="." from="*"/>
     </input>
   </operation>
 </sequence>
</process>

Other examples you can see here Amazon Web Service Simple Storage Service

Configure Sterling File Gateway to store files in MinIO (S3 storage)

1) Generate Obscured Access Key and Obscured Secret Key

In the fields Obscured Access Key and Obscured Secret Key, you must enter the obscure key.

So you need to run the obscure command

/opt/IBM/SterlingIntegrator/bin/obscure_passphrase.sh <keys>

2) The EndPointURL

Our minio server is not configured with https, so in the enpoint field I will provide the protocol/address/port.

3) Create a Partner and setup configuration for S3

Important 1: In the fields Obscured Access Key and Obscured Secret Key, you must enter the obscure key.

So you need to run the obscure command

/opt/IBM/SterlingIntegrator/bin/obscure_passphrase.sh <keys>

Get the output and fill in that fields

My example:

2) Create a Routing Channel

3) Create a Channel

Ver também