{"id":21505444,"url":"https://github.com/ibm-messaging/mq-dev-badge-sample","last_synced_at":"2026-01-04T06:06:08.191Z","repository":{"id":33935408,"uuid":"148301084","full_name":"ibm-messaging/mq-dev-badge-sample","owner":"ibm-messaging","description":"Sample code of the MQ developer essentials badge","archived":false,"fork":false,"pushed_at":"2024-08-28T08:43:09.000Z","size":463,"stargazers_count":13,"open_issues_count":1,"forks_count":37,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-23T23:52:59.920Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ibm-messaging.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-11T10:33:57.000Z","updated_at":"2024-08-28T08:43:13.000Z","dependencies_parsed_at":"2024-08-07T13:28:25.798Z","dependency_job_id":null,"html_url":"https://github.com/ibm-messaging/mq-dev-badge-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-messaging%2Fmq-dev-badge-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-messaging%2Fmq-dev-badge-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-messaging%2Fmq-dev-badge-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibm-messaging%2Fmq-dev-badge-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibm-messaging","download_url":"https://codeload.github.com/ibm-messaging/mq-dev-badge-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244047647,"owners_count":20389206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-23T19:03:20.794Z","updated_at":"2026-01-04T06:06:08.138Z","avatar_url":"https://github.com/ibm-messaging.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MQ Badge developer challenge\nThis is the Java template with code stubs for the MQ Badge developer challenge. You can use this code as a starting point as you build a messaging application that integrates a ticket reseller with an event booking system.\n\n[Take a look at the IBM Developer Essentials course](https://ibm.biz/mq-badge)\n\n## Prerequisites\nYou will need to download and install [Maven](https://maven.apache.org/download.cgi) for this application to work.\n\n**note** `if you are using podman, replace 'docker' in the commands below with 'podman'`\n\n## Ticket Service\nFor convenience the Ticket Service is provided as MQ docker image. When started it will start\nboth MQ server and the Ticket service. The MQ Server is configured to create and configure the\nqueues and topics that the Ticket Service requires.\n\n## Docker FROM \nThe Dockerfile bases its image on icr.io/ibm-messaging/mq:latest by default(for AMD64 and x86-64 architecture). \nThis image is pulled from the IBM Container Registry.\n\nIf you are using a MacOS Silicon (ARM64) system, you will need to build and run an IBM MQ container image natively.\nYou can do so using the link below:\nhttps://community.ibm.com/community/user/integration/blogs/richard-coppen/2023/06/30/ibm-mq-9330-container-image-now-available-for-appl\n\nThen check which image you have:\n````\ndocker images\n````\nYour baseImageRunStage argument will be \"repositoryName:tagName\", which will be used when building your docker image.\nFor example:\nbaseImageRunStage=\"localhost/ibm-mqadvanced-server-dev:9.4.0.0-arm64\"\n\n\nThe ticker reseller docker file will not run with\n* 9.1.4.0-r1\nor earlier.\n\nRunning the following command will determine which version you are using.\n\n````\ndocker image inspect \u003cyour image id\u003e --format '{{.ContainerConfig.Labels.version}}'\n````\n\n### Docker Build\nTo build the docker image, open a terminal, navigate to the `MQTicketService`\ndirectory, then run\n\nFor Mac or Linux users:\nThe default arguments must be overidden with the correct platform architecture and images.\n**note** `--build-arg baseImageRunStage` \n````\ndocker build --build-arg platformArch=arm64 --build-arg baseImageRunStage=\"localhost/ibm-mqadvanced-server-dev:9.4.0.0-arm64\" . -t mqbadge:latest\n````\n\nFor Windows users:\n````\ndocker build . -t mqbadge:latest\n````     \n\n### Docker Run\nTo start the container, run\n\n````\ndocker run -e LICENSE=accept -e MQ_QMGR_NAME=QM1 -e LOG_FORMAT=json -e MQ_APP_PASSWORD=passw0rd -p 1414:1414 -p 9443:9443 --detach -ti --name mqebs mqbadge:latest\n````\n\nThis will configure and start the MQ Server, then will start the Ticket Service application.\n\n### Docker Restart\nThe Ticket Service will time it self out. To restart a stopped container run\n\n````\ndocker restart mqebs\n````\nThen you can attach to the container to see its output:\n````\ndocker attach mqebs\n````\n\n### ModelAnswer\nOpen another terminal alongside the TicketService.\n\nIf you have installed Maven, change your working directory to `ModelAnswer`.\n\nTo create the `.jar` file with the dependencies required for the application, run the following command:\n\n````\nmvn clean package\n````\n\n## Reseller.java\nThe main entry point for the reseller application is in Reseller.java\n\n## Challenge Code Changes\nFor the challenge you will make code updates to `SessionBuilder.java`,\n`TicketSubscriber.java` and `TicketRequester.java`.\n\n## Application\nThe application will run as a code stub. When run the application logs will\nindicate where code changes need to be made.\n\nTo run the application\n\nFor Mac and Linux users:\n````\njava -cp target/ModelAnswer-1.4.jar:. com.ibm.mq.demo.Reseller\n````\nFor Windows users:\n````\njava -cp target/ModelAnswer-1.4.jar com.ibm.mq.demo.Reseller\n````\n\n## Environment variables\nYou can override the default MQ connection settings using environment variables on the system where you run your Reseller application code.\n\n* **MQ_BADGE_QM_HOSTNAME** - Specify the Host name or IP address of your queue manager\n* **MQ_BADGE_QM_NAME** - Set the queue manager name\n* **MQ_BADGE_QM_PORT** - Listener port for your queue manager\n* **MQ_BADGE_CHANNEL** - MQ Channel name\n* **MQ_BADGE_USER** - User name that application uses to connect to MQ\n* **MQ_BADGE_PASSWORD** - Password that the application uses to connect to MQ\n\nThis is the default configuration. Run the following in your command terminal.\n\nFor Mac and Linux users:\n```\nexport MQ_BADGE_QM_HOSTNAME = \"localhost\"\nexport MQ_BADGE_QM_NAME = \"QM1\"\nexport MQ_BADGE_QM_PORT = 1414\nexport MQ_BADGE_CHANNEL = \"DEV.APP.SVRCONN\"\nexport MQ_BADGE_USER = \"app\"\nexport MQ_BADGE_PASSWORD = \"passw0rd\"\n```\n\nFor Windows users:\n```\nset MQ_BADGE_QM_HOSTNAME = \"localhost\"\nset MQ_BADGE_QM_NAME = \"QM1\"\nset MQ_BADGE_QM_PORT = 1414\nset MQ_BADGE_CHANNEL = \"DEV.APP.SVRCONN\"\nset MQ_BADGE_USER = \"app\"\nset MQ_BADGE_PASSWORD = \"passw0rd\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm-messaging%2Fmq-dev-badge-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibm-messaging%2Fmq-dev-badge-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm-messaging%2Fmq-dev-badge-sample/lists"}