|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Java user-defined node cannot connect with node properties |
« View previous topic :: View next topic » |
Author |
Message
|
Dmitry |
Posted: Thu Jun 21, 2018 11:54 pm Post subject: Java user-defined node cannot connect with node properties |
|
|
Newbie
Joined: 21 Jun 2018 Posts: 2
|
Hello.
I have spent last 2 week for create user-defined node by Java.
The are huge heap of problems.
But the last one problem I cannot resolved.
My node java class cannot access to node properties.
MQ 9.0
IIB 10.0.0.12
Sometimes properties in classes init like null but sometimes like ""(zero length string).
When I redeploy app with UD node setLevel() method has not done.
But when I readd jar with node class and restart integratiation node setLevel() have done.
I expect then every app deploy with UD node set's methods will be done.
For me it looks like a magic.
Can somebody experience with java UDN with properties?
[package ...
import ...
public class Log4jNode extends MbNode implements MbNodeInterface {
private String logLevel;
private String pattern;
private String date;
private String baseLogsPath;
private String logToAppFolder;
private String logToCustomPath;
@Override
public void evaluate(MbMessageAssembly arg0, MbInputTerminal arg1)
throws MbException {
MbMessage outMbMessage = new MbMessage(arg0.getMessage());
MbMessageAssembly outAssembly = new MbMessageAssembly(arg0, outMbMessage);
outMbMessage.getRootElement().getLastChild().getLastChild().createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "level 10.22 " + date, logLevel); outMbMessage.getRootElement().getLastChild().getLastChild().createElementAsLastChild(MbElement.TYPE_NAME_VALUE, "pattern", pattern);
getOutputTerminal("out").propagate(outAssembly);
}
public String getLevel() {
return logLevel;
}
public void setLevel(String level) {
date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(new Date());
if (date == null)
date = "nullS";
this.logLevel = level;
}
public String getBaseLogsPath() {
return baseLogsPath;
}
public void setBaseLogsPath(String baseLogsPath) {
this.baseLogsPath = baseLogsPath;
}
public String getLogToAppFolder() {
return logToAppFolder;
}
public void setLogToAppFolder(String logToAppFolder) {
this.logToAppFolder = logToAppFolder;
}
public String getLogToCustomPath() {
return logToCustomPath;
}
public void setLogToCustomPath(String logToCustomPath) {
this.logToCustomPath = logToCustomPath;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
public String getPattern() {
return pattern;
}
public Log4jNode() throws MbException
{
// create terminals here
createInputTerminal("in");
createOutputTerminal("out");
createOutputTerminal("failure");
}
public static String getNodeName()
{
return "Log4jNode";
}
}
]
Node properties
[/#This is a generated file.
# The values in this file have syntax: key = value
#User modifications to the values in this file will be preserved
#Thu Jun 21 15:16:07 MSK 2018
Log4j=Log4j
Group.Basic=Basic
Property.logToCustomPath=logToCustomPath
OutTerminal.out=out
OutTerminal.failure=failure
Property.baseLogsPath=baseLogsPath
InTerminal.in=in
Property.pattern=pattern
Property.level=level
Property.logToAppFolder=logToAppFolder
Group.Advanced=Advanced] |
|
Back to top |
|
 |
Dmitry |
Posted: Fri Jun 22, 2018 12:31 am Post subject: |
|
|
Newbie
Joined: 21 Jun 2018 Posts: 2
|
|
Back to top |
|
 |
timber |
Posted: Fri Jun 22, 2018 8:46 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Quote: |
Sometimes properties in classes init like null but sometimes like ""(zero length string).
When I redeploy app with UD node setLevel() method has not done.
But when I readd jar with node class and restart integratiation node setLevel() have done.
I expect then every app deploy with UD node set's methods will be done.
For me it looks like a magic. |
This is quite a deep technical question, and you have supplied a lot of information (thanks). Unfortunately, I don't understand exactly what your current problem is. Please can you state the problem again, explaining clearly what you expected to happen and what actually happened. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|