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

Use sockets #154

Closed
wants to merge 26 commits into from
Closed

Use sockets #154

wants to merge 26 commits into from

Conversation

jonnyz32
Copy link
Collaborator

@jonnyz32 jonnyz32 commented Sep 27, 2024

  • Replace db2_publish_message communication to use sockets. Will replace others once we implement the listeners in camel
  • Fix the ccsid issue as we aren't using sql anymore
  • Fix the performance/scalability issue as socket communication is much faster than sql communication

Thank you to @SanjulaGanepola for helping me to work out some extremely weird ccsid issues which were fixed by adding TGTCCSID(*JOB) in the makefile

@jonnyz32 jonnyz32 linked an issue Sep 27, 2024 that may be closed by this pull request
@jonnyz32 jonnyz32 marked this pull request as ready for review September 27, 2024 17:43
@jonnyz32 jonnyz32 requested a review from ThePrez September 27, 2024 22:01
ile/src/SockClient.h Outdated Show resolved Hide resolved
ile/src/pub_db2.sqlc Show resolved Hide resolved
ile/src/pub_db2.sqlc Show resolved Hide resolved
test/e2e/msg/snd2q/data.ini Outdated Show resolved Hide resolved
@@ -33,8 +33,9 @@ public String format(final Map<String, Object> _mappings) {
ret = ret.replace("\\n", "\n").replace("\\t", "\t");

for (final Entry<String, Object> repl : _mappings.entrySet()) {
ret = ret.replace("$" + repl.getKey() + "$", "" + repl.getValue());
String jsonIndicator ="$json:" + repl.getKey() + "$";
final String key = repl.getKey().toUpperCase();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes the key match case insensitive


/qsys.lib/${BUILDLIB}.lib/%.module: src/%.sqlc
system "CRTSQLCI OBJ(${BUILDLIB}/$*) SRCSTMF('$(CURDIR)/$^') COMMIT(*NONE) DATFMT(*ISO) TIMFMT(*ISO) DBGVIEW(*SOURCE) CVTCCSID(*JOB) COMPILEOPT('INCDIR(''src'')') SQLPATH(${BUILDLIB}) DFTRDBCOL(${BUILDLIB}) OPTION(*SQL)"
system "CRTSQLCPPI OBJ(${BUILDLIB}/$*) SRCSTMF('$(CURDIR)/$^') COMMIT(*NONE) DATFMT(*ISO) TIMFMT(*ISO) DBGVIEW(*SOURCE) CVTCCSID(*JOB) COMPILEOPT('INCDIR(''src'')') SQLPATH(${BUILDLIB}) DFTRDBCOL(${BUILDLIB}) OPTION(*SQL)"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The program uses cpp functions now, so we need to use CRTSQLCPPI instead


/qsys.lib/${BUILDLIB}.lib/%.pgm:
system "CRTPGM PGM(${BUILDLIB}/$*) MODULE($(patsubst %.module,$(BUILDLIB)/%,$(notdir $^))) ACTGRP(*CALLER)"

/qsys.lib/${BUILDLIB}.lib/%.module: src/%.cpp src/mzversion.h
system "CRTCPPMOD MODULE(${BUILDLIB}/$*) SRCSTMF('$(CURDIR)/$<') OPTION(*EVENTF) SYSIFCOPT(*IFS64IO) DBGVIEW(*SOURCE) TERASPACE(*YES *TSIFC) STGMDL(*SNGLVL) DTAMDL(*p128) DEFINE(DEBUG_ENABLED)"
system "CRTCPPMOD MODULE(${BUILDLIB}/$*) SRCSTMF('$(CURDIR)/$<') OPTION(*EVENTF) SYSIFCOPT(*IFS64IO) DBGVIEW(*SOURCE) TERASPACE(*YES *TSIFC) STGMDL(*SNGLVL) DTAMDL(*p128) DEFINE(DEBUG_ENABLED) OUTPUT(*PRINT) TGTCCSID(*JOB)"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding TGTCCSID(*JOB) seemed to resolve encoding issues

ile/src/pub_db2.sqlc Show resolved Hide resolved
ile/src/pub_db2.sqlc Show resolved Hide resolved
ile/src/SockClient.h Outdated Show resolved Hide resolved
Copy link
Collaborator

@SanjulaGanepola SanjulaGanepola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Great work

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