[日常工作]GS使用消息队列进行凭证实时记账 提高性能配置方法

时间:2023-12-22 22:31:44

1. 安装消息队列服务

使用平台技术部的一键安装工具,安装. 自带jdk以及activeMQ 自动注册服务. 比较方便.

2. 修改/gsp/config下面的MQ配置文件,将消息队列服务修改为当前虚拟机的地址 或者是 127.0.0.1

3. 打开GS7->系统公共->公共服务->队列配置.

如果没有的话先预制SS账的SQL

例如: Oracle

declare vCount1 int := 0;
begin
select count(1) into vCount1 from user_all_Tables where upper(Table_Name) = upper('MQQUEUECONF');
if(vCount1 > 0 ) then

execute immediate ( ' delete from mqqueueconf where queueID=''4caad698-48b9-49e1-9789-e715c421017f'' ');
execute immediate ( ' delete from MQSchedule where ScheduleID=''4caad698-48b9-49e1-9789-e715c421017f''');
execute immediate ( ' delete from MQTask where TaskID=''4caad698-48b9-49e1-9789-e715c421017f'' ');

execute immediate ( ' insert into mqqueueconf(queueID,queueName,serverIP,serverPort,IsSys,Creator,CreateTime) values(''4caad698-48b9-49e1-9789-e715c421017f'',''ZWPZSSJZ'',''10.24.11.179'',''61616'',0,''9999'',sysdate) ');
execute immediate ( ' insert into MQSchedule (ScheduleID,QueueID,InvokeTaskID,IfRepeat,RepeatNum,ExceptionPolicy,EnqueueCount,DimensionID,CompensateTaskID,NotifyEventType,NotifyType) values(''4caad698-48b9-49e1-9789-e715c421017f'',''4caad698-48b9-49e1-9789-e715c421017f'',''4caad698-48b9-49e1-9789-e715c421017f'',1,0,0,0,'''','''','''','''') ');
execute immediate ( ' insert into MQTask(TaskID,ScheduleID,TaskType,ComponentID,InvokeAssembly,InvokeClass,InvokeMethod) values(''4caad698-48b9-49e1-9789-e715c421017f'',''4caad698-48b9-49e1-9789-e715c421017f'',0,'''',''Genersoft.FI.ZW.ZW_VoucherInterface_RealTally, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'',''Genersoft.FI.ZW.ZW_VoucherInterface_RealTally.VoucherRtTallyMQ'',''Run'') ');

end if;
end;
GO

sqlserver 

IF EXISTS (SELECT 1 FROM SYSOBJECTS WHERE ID = OBJECT_ID('MQQUEUECONF') AND TYPE = 'U')
begin
IF not EXISTS(select 1 from mqqueueconf where queueName = 'ZWPZSSJZ' )
begin
insert into mqqueueconf(queueID,queueName,serverIP,serverPort,IsSys,Creator,CreateTime)
values('4caad698-48b9-49e1-9789-e715c421017f','ZWPZSSJZ','10.24.11.179','61616',0,'9999',GETDATE())
insert into MQSchedule (ScheduleID,QueueID,InvokeTaskID,IfRepeat,RepeatNum,ExceptionPolicy,EnqueueCount,DimensionID,CompensateTaskID,NotifyEventType,NotifyType)
values('4caad698-48b9-49e1-9789-e715c421017f','4caad698-48b9-49e1-9789-e715c421017f','4caad698-48b9-49e1-9789-e715c421017f',1,0,0,0,'','','','')
insert into MQTask(TaskID,ScheduleID,TaskType,ComponentID,InvokeAssembly,InvokeClass,InvokeMethod)
values('4caad698-48b9-49e1-9789-e715c421017f','4caad698-48b9-49e1-9789-e715c421017f',0,'','Genersoft.FI.ZW.ZW_VoucherInterface_RealTally, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null','Genersoft.FI.ZW.ZW_VoucherInterface_RealTally.VoucherRtTallyMQ','Run')
end
end
GO

修改配置 并且启用

[日常工作]GS使用消息队列进行凭证实时记账 提高性能配置方法

4. 进入 服务器端 bin目录 打开 MQconsole服务

注册服务 并且启动

5. 修改相关参数:

INSERT INTO LSGSCS@YR@( LSGSCS_MKID,LSGSCS_HSDW,LSGSCS_KEY,LSGSCS_VALUE,LSGSCS_NOTE) values('ZW',' ','ZW_PZSSJZMQ','1','制单保存启用消息队列 ')

6. 制单就可以使用消息队列了.