File tree Expand file tree Collapse file tree 6 files changed +66
-3
lines changed Expand file tree Collapse file tree 6 files changed +66
-3
lines changed Original file line number Diff line number Diff line change 1
1
FROM golang:1.15 as builder
2
2
ENV APP_USER app
3
3
ENV APP_HOME /go/src/openshift-app-sample
4
+ RUN mkdir -p /opt/mqm \
5
+ && chmod a+rx /opt/mqm
6
+ # Location of the downloadable MQ client package \
7
+ ENV RDURL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/messaging/mqdev/redist" \
8
+ RDTAR="IBM-MQC-Redist-LinuxX64.tar.gz" \
9
+ VRMF=9.2.0.1
10
+ # Install the MQ client from the Redistributable package. This also contains the
11
+ # header files we need to compile against. Setup the subset of the package
12
+ # we are going to keep - the genmqpkg.sh script removes unneeded parts
13
+ ENV genmqpkg_incnls=1 \
14
+ genmqpkg_incsdk=1 \
15
+ genmqpkg_inctls=1
16
+ RUN cd /opt/mqm \
17
+ && curl -LO "$RDURL/$VRMF-$RDTAR" \
18
+ && tar -zxf ./*.tar.gz \
19
+ && rm -f ./*.tar.gz \
20
+ && bin/genmqpkg.sh -b /opt/mqm
4
21
RUN groupadd $APP_USER && useradd -m -g $APP_USER -l $APP_USER
5
22
RUN mkdir -p $APP_HOME && chown -R $APP_USER:$APP_USER $APP_HOME
6
23
WORKDIR $APP_HOME
15
32
RUN mkdir -p $APP_HOME
16
33
WORKDIR $APP_HOME
17
34
COPY --chown=0:0 --from=builder $APP_HOME/openshift-app-sample $APP_HOME
35
+ COPY --chown=0:0 --from=builder /opt/mqm /opt/mqm
18
36
USER $APP_USER
19
- CMD ["./openshift-app-sample" ]
37
+ CMD ["./openshift-app-sample" ]
38
+ # CMD ["/bin/bash"]
Original file line number Diff line number Diff line change
1
+ src
2
+
Original file line number Diff line number Diff line change
1
+ module github.com/ibm-messaging/mq-golang-jms20/openshift-app-sample/src
2
+
3
+ go 1.13
4
+
5
+ require github.com/ibm-messaging/mq-golang-jms20 v1.2.0
Original file line number Diff line number Diff line change
1
+ github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
2
+ github.com/ibm-messaging/mq-golang-jms20 v1.2.0 h1:pVB4fPpyaEh8fTmyGBH4BlnLINB9f8z9CZdwLY4m4rM =
3
+ github.com/ibm-messaging/mq-golang-jms20 v1.2.0 /go.mod h1:l6BQdpzorRc27vFbrLSrUJXfP1kyzTXINQX/O2MIiSk =
4
+ github.com/ibm-messaging/mq-golang/v5 v5.0.0 h1:9J8bsDoCo60rbSgB7ZAURPG3L5Kpr+F8dYNOwQ7Qnnk =
5
+ github.com/ibm-messaging/mq-golang/v5 v5.0.0 /go.mod h1:ywCwmYbJOU/E0rl+z4GiNoxVMty68O+LVO39a1VMXrE =
6
+ github.com/pmezard/go-difflib v1.0.0 /go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4 =
7
+ github.com/stretchr/objx v0.1.0 /go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME =
8
+ github.com/stretchr/testify v1.4.0 /go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4 =
9
+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 /go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0 =
10
+ gopkg.in/yaml.v2 v2.2.2 /go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI =
Original file line number Diff line number Diff line change 9
9
// Package main provides the entry point for a executable application.
10
10
package main
11
11
12
- import "fmt"
12
+ import (
13
+ "fmt"
14
+ "log"
15
+
16
+ "github.com/ibm-messaging/mq-golang-jms20/mqjms"
17
+ )
13
18
14
19
func main () {
15
- fmt .Println ("Hello World!!!" )
20
+ fmt .Println ("Beginning world!!!" )
21
+
22
+ cf := mqjms.ConnectionFactoryImpl {
23
+ QMName : "QM1" ,
24
+ Hostname : "myhostname.com" ,
25
+ PortNumber : 1414 ,
26
+ ChannelName : "SYSTEM.DEF.SVRCONN" ,
27
+ UserName : "username" ,
28
+ Password : "password" ,
29
+ }
30
+
31
+ // Creates a connection to the queue manager, using defer to close it automatically
32
+ // at the end of the function (if it was created successfully)
33
+ context , errCtx := cf .CreateContext ()
34
+ if context != nil {
35
+ defer context .Close ()
36
+ }
37
+
38
+ if errCtx != nil {
39
+ log .Fatal (errCtx )
40
+ }
41
+
42
+ fmt .Println ("Ending world!!!" )
16
43
}
You can’t perform that action at this time.
0 commit comments