Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How To set CCSID to 1386? #572

Open
MikyWang opened this issue Jul 31, 2024 · 3 comments
Open

How To set CCSID to 1386? #572

MikyWang opened this issue Jul 31, 2024 · 3 comments

Comments

@MikyWang
Copy link

I want to deal message with GBK Encoding

@MikyWang MikyWang changed the title How To set CCSID to 1389? How To set CCSID to 1386? Jul 31, 2024
@arthurbarr
Copy link
Member

arthurbarr commented Jul 31, 2024

You need a container with the right language pack installed. Unfortunately, the Red Hat Universal Base Image (UBI) repos only supply a single language pack for English. Other language packs require a Red Hat subscription.

If you are a Red Hat Enterprise Linux (RHEL) customer, with a valid subscription, then you can add the language packs onto an existing MQ image. You can create a Dockerfile/Containerfile like this:

FROM icr.io/ibm-messaging/mq
USER 0
RUN microdnf install -y glibc-langpack-zh
USER 1001
ENV LANG=zh_CN.GBK

If you then podman build -t mq-zh ., you will get a new container. Note that this will only work on a valid RHEL host with an active subscription, and the resulting container is only licensed to run on RHEL hosts. I have tried this and can run the container, with the following log output. The messages from code in this repo (i.e. the Go code) are not translated, but the other messages are.

2024-07-31T15:59:37.883Z CPU architecture: amd64
2024-07-31T15:59:37.883Z Linux kernel version: 5.14.0-427.20.1.el9_4.x86_64
2024-07-31T15:59:37.883Z Base image: Red Hat Enterprise Linux 9.4 (Plow)
2024-07-31T15:59:37.884Z Running as user ID 1001 with primary group 0, and supplementary groups 0
2024-07-31T15:59:37.884Z Capabilities (bounding set): chown,dac_override,fowner,fsetid,kill,setgid,setuid,setpcap,net_bind_service,sys_chroot,setfcap
2024-07-31T15:59:37.884Z seccomp enforcing mode: filtering
2024-07-31T15:59:37.884Z Process security attributes: kernel
2024-07-31T15:59:37.885Z No volume detected. Persistent messages may be lost
2024-07-31T15:59:37.927Z Using queue manager name: 104abaa1ea0b
2024-07-31T15:59:37.977Z Created directory structure under /var/mqm
2024-07-31T15:59:37.977Z Image created: 2024-07-18T15:30:43+00:00
2024-07-31T15:59:37.977Z Image tag: ibm-mqadvanced-server-dev:9.4.0.0-r3.20240718152536.ff62130-amd64
2024-07-31T15:59:38.021Z MQ version: 9.4.0.0
2024-07-31T15:59:38.021Z MQ level: p940-L240605.1
2024-07-31T15:59:38.021Z MQ license: Developer
2024-07-31T15:59:43.495Z FIPS cryptography is not enabled.
2024-07-31T15:59:43.495Z Creating queue manager 104abaa1ea0b
2024-07-31T15:59:43.496Z Starting web server
2024-07-31T15:59:47.107Z Created queue manager
2024-07-31T15:59:46.685Z product = WebSphere Application Server 24.0.0.3 (wlp-1.0.87.cl240320240311-1901)\nwlp.install.dir = /opt/mqm/web/\nserver.config.dir = /mnt/mqm/data/web/installations/Installation1/servers/mqweb/\njava.home = /opt/mqm/java/jre64/jre\njava.version = 1.8.0_411\njava.runtime = Java(TM) SE Runtime Environment (8.0.8.25 - pxa6480sr8fp25-20240328_01(SR8 FP25))\nos = Linux (5.14.0-427.20.1.el9_4.x86_64; amd64) (zh_CN)\nprocess = 691@10.88.0.7\nClasspath = /opt/mqm/web/bin/tools/ws-server.jar:/opt/mqm/web/bin/tools/ws-javaagent.jar\nJava Library path = /opt/mqm/java/jre64/jre/lib/amd64/compressedrefs:/opt/mqm/java/jre64/jre/lib/amd64:/opt/mqm/java/lib64:/opt/mqm/lib64:/opt/mqm/lib:/usr/lib64:/usr/lib\n
2024-07-31T15:59:46.797Z CWWKE0001I: 已启动服务器 mqweb。
2024-07-31T15:59:47.156Z Starting queue manager
2024-07-31T15:59:43.882Z AMQ6287I: IBM MQ V9.4.0.0 (p940-L240605.1)。 [CommentInsert1(Linux 5.14.0-427.20.1.el9_4.x86_64 (MQ Linux (x86-64 platform) 64-bit)), CommentInsert2(/opt/mqm (Installation1)), CommentInsert3(9.4.0.0 (p940-L240605.1))]
2024-07-31T15:59:44.186Z AMQ7229I: 在日志重放阶段在队列管理器“104abaa1ea0b”上访问了 4 条日志记录。 [ArithInsert1(4), CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:44.188Z AMQ7230I: 完成队列管理器“104abaa1ea0b”的日志重放。 [ArithInsert1(4), CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:44.194Z AMQ7231I: 在恢复阶段在队列管理器“104abaa1ea0b”上访问了 0 条日志记录。 [CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:44.195Z AMQ7232I: 为队列管理器“104abaa1ea0b”恢复了事务管理器状态。 [CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:44.209Z AMQ7233I: 对于队列管理器 104abaa1ea0b,0 正在执行事务中的 0 个事务已经被解决。 [CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:46.632Z AMQ8048I: 缺省对象统计:84 个已创建。0 个已替换。0 个已失败。 [ArithInsert1(84), CommentInsert1(0)]
2024-07-31T15:59:46.660Z AMQ8003I: 使用 V9.4.0.0 启动了 IBM MQ 队列管理器“104abaa1ea0b”。 [CommentInsert1(9.4.0.0), CommentInsert3(104abaa1ea0b)]
2024-07-31T15:59:46.941Z AMQ8004I: IBM MQ 队列管理器‘104abaa1ea0b’已结束。 [CommentInsert3(104abaa1ea0b)]
2024-07-31T15:59:47.208Z AMQ6206I: 已发出命令 strmqm。 [CommentInsert1(strmqm), CommentInsert2(strmqm -x 104abaa1ea0b)]
2024-07-31T15:59:47.212Z AMQ5782I: 包含“/mnt/mqm/data/qmgrs/104abaa1ea0b”的文件系统已使用 2.97%,可用空间为 231411MB。 [ArithInsert1(2.97), CommentInsert1(/mnt/mqm/data/qmgrs/104abaa1ea0b), CommentInsert2(238476), CommentInsert3(231411)]
2024-07-31T15:59:47.222Z AMQ5782I: 包含“/mnt/mqm/data/log/104abaa1ea0b”的文件系统已使用 2.96%,可用空间为 231427MB。 [ArithInsert1(2.96), CommentInsert1(/mnt/mqm/data/log/104abaa1ea0b), CommentInsert2(238476), CommentInsert3(231427)]
2024-07-31T15:59:47.301Z AMQ5775I: 已成功应用自动配置 INI 定义。 [CommentInsert1(INI)]
2024-07-31T15:59:47.654Z AMQ7229I: 在日志重放阶段在队列管理器“104abaa1ea0b”上访问了 6 条日志记录。 [ArithInsert1(6), CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:47.655Z AMQ7230I: 完成队列管理器“104abaa1ea0b”的日志重放。 [ArithInsert1(6), CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:47.663Z AMQ7231I: 在恢复阶段在队列管理器“104abaa1ea0b”上访问了 0 条日志记录。 [CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:47.663Z AMQ7232I: 为队列管理器“104abaa1ea0b”恢复了事务管理器状态。 [CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:47.703Z AMQ7233I: 对于队列管理器 104abaa1ea0b,0 正在执行事务中的 0 个事务已经被解决。 [CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:47.950Z AMQ8003I: 使用 V9.4.0.0 启动了 IBM MQ 队列管理器“104abaa1ea0b”。 [CommentInsert1(9.4.0.0), CommentInsert3(104abaa1ea0b)]
2024-07-31T15:59:48.036Z AMQ9410I: 存储库管理器已启动。
2024-07-31T15:59:48.064Z AMQ5024I: 命令服务器已启动。进程标识 (803)。 [ArithInsert1(803), CommentInsert1(SYSTEM.CMDSERVER.1)]
2024-07-31T15:59:48.067Z AMQ5022I: 通道启动程序已启动。进程标识 (804)。 [ArithInsert1(804), CommentInsert1(SYSTEM.CHANNEL.INITQ)]
2024-07-31T15:59:48.201Z AMQ8942I: 开始处理自动 MQSC 配置脚本。
2024-07-31T15:59:48.209Z AMQ8024I: IBM MQ 通道启动程序已启动。 [CommentInsert1(SYSTEM.CHANNEL.INITQ)]
2024-07-31T15:59:48.837Z Started queue manager
2024-07-31T15:59:48.837Z Metrics are disabled
2024-07-31T15:59:48.755Z AMQ8939I: 自动 MQSC 配置脚本已完成,并且包含 25 个命令,其中 0 个有错误。 [ArithInsert1(25), CommentInsert1(0)]
2024-07-31T15:59:48.795Z AMQ5026I: 侦听器“SYSTEM.LISTENER.TCP.1”已启动。进程标识 (843)。 [ArithInsert1(843), CommentInsert1(SYSTEM.LISTENER.TCP.1)]
2024-07-31T15:59:48.793Z AMQ9722W: 已启用纯文本通信。
2024-07-31T15:59:49.051Z AMQ5806I: 队列管理器 104abaa1ea0b 的列队发布/预订守护程序已经启动。 [CommentInsert1(104abaa1ea0b)]
2024-07-31T15:59:51.848Z CWWKG0028A: 正在处理所包含的配置资源:/opt/mqm/web/mq/etc/mqweb.xml
2024-07-31T15:59:51.935Z CWWKG0028A: 正在处理所包含的配置资源:/mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebcontainer.xml
2024-07-31T15:59:51.943Z CWWKG0028A: 正在处理所包含的配置资源:/mnt/mqm/data/web/installations/Installation1/servers/mqweb/tls.xml
2024-07-31T15:59:51.966Z CWWKG0028A: 正在处理所包含的配置资源:/mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebexternal.xml
2024-07-31T15:59:51.971Z CWWKG0028A: 正在处理所包含的配置资源:/mnt/mqm/data/web/installations/Installation1/servers/mqweb/mqwebuser.xml
2024-07-31T15:59:52.944Z CWWKE0002I: 内核在 7.063 秒 后启动
2024-07-31T15:59:53.554Z CWWKF0007I: 功能部件更新已开始。

@arthurbarr
Copy link
Member

On my machine, I can check that I have the right CCSID:

echo "display qmgr ccsid" | podman exec -ti df7 runmqsc
display qmgr ccsid
5724-H72 (C) Copyright IBM Corp. 1994, 2024.
???????й????? df7681d17f04 ?? MQSC??


display qmgr ccsid
     1 : display qmgr ccsid
AMQ8408I: ??ʾ???й???????ϸ?ڡ?
   QMNAME(df7681d17f04)                    CCSID(1386)

(where df7 is the ID of my running queue manager container)

@arthurbarr
Copy link
Member

Correction: I have now learned that UBI does include language packs in the glibc-all-langpacks package. This means you can build a container with the following Dockerfile on any host (i.e. it doesn't need to be RHEL any more):

FROM icr.io/ibm-messaging/mq
USER 0
RUN microdnf install -y glibc-all-langpacks
USER 1001
ENV LANG=zh_CN.GBK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants