ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportJava user-defined node cannot connect with node properties

Post new topicReply to topic
Java user-defined node cannot connect with node properties View previous topic :: View next topic
Author Message
Dmitry
PostPosted: Thu Jun 21, 2018 11:54 pm Post subject: Java user-defined node cannot connect with node properties Reply with quote

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
View user's profile Send private message
Dmitry
PostPosted: Fri Jun 22, 2018 12:31 am Post subject: Reply with quote

Newbie

Joined: 21 Jun 2018
Posts: 2

Win 2008 server r2 ent
Back to top
View user's profile Send private message
timber
PostPosted: Fri Jun 22, 2018 8:46 am Post subject: Reply with quote

Sentinel

Joined: 25 Aug 2015
Posts: 839

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
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportJava user-defined node cannot connect with node properties
Jump to:



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
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.