Closed itzikb closed 4 years ago
@Zlopez Can you please take a look at this one?
@itzikb Do you have the logs of job2, there should be the exact message you get on INFO log level.
@Zlopez I'm having a different problem now when trying to reproduce. The IP of the RabbitMQ server changed. I Changed it in JMS Messaging Providers but In the log I see that the old IP is used (Even though the new one is saved).
Restarting Jenkins - the IP changed (Is it a known bug)?
Which Log are you referring to?
Jenkins Log
Scheduling job 'test2' based on message:
{"foo":"boo1"}
Mar 30, 2020 5:59:11 PM WARNING hudson.security.csrf.CrumbFilter doFilter
Found invalid crumb 7c95c9e6a4bfbcfeeba39e02775963f7efdd40857f41a9773b694e831daca69c. If you are calling this URL with a script, please use the API Token instead. More information: https://jenkins.io/redirect/crumb-cannot-be-used-for-script
Mar 30, 2020 5:59:11 PM WARNING hudson.security.csrf.CrumbFilter doFilter
No valid crumb was included in request for /ajaxBuildQueue by admin. Returning 403.
Mar 30, 2020 5:59:11 PM WARNING hudson.security.csrf.CrumbFilter doFilter
Found invalid crumb 7c95c9e6a4bfbcfeeba39e02775963f7efdd40857f41a9773b694e831daca69c. If you are calling this URL with a script, please use the API Token instead. More information: https://jenkins.io/redirect/crumb-cannot-be-used-for-script
Mar 30, 2020 5:59:11 PM WARNING hudson.security.csrf.CrumbFilter doFilter
No valid crumb was included in request for /ajaxExecutors by admin. Returning 403.
Job2 console log
Triggered by CI message.
Running as SYSTEM
Building in workspace /var/jenkins_home/workspace/test2
[test2] $ /bin/sh -xe /tmp/jenkins8746323871627348214.sh
+ echo hello2!
hello2!
+ echo message is {"foo":"boo1"}
message is {"foo":"boo1"}
Finished: SUCCESS
@itzikb The first log is what I needed to verify the received message.
@scoheb For check verification I'm using the same approach as in ActiveMQ, so this looks more like issue in the ProviderData.verify
method. Isn't there something similar to like instead of exact match?
@scoheb Looking at the code, this is the exact method that is called to verify the checks JMSMessagingProvider.verify
The current default behaviour is that we use the following in the verify()
method:
return Pattern.compile(expectedValue).matcher(actualValue).find();
which returns true for:
def expectedValue = "boo"
def actualValue = "boo1"
If you want an exact match, then you need to use a regexp
expectedValue = "^boo$"
I have two freestyle jobs: One that I configure with CI notifier and the other one which I have a build trigger. job1 definition job2 definition
The second job is triggered even though it shouldn't (If I understand correctly) because it expected the message to hold {"foo":"boo"} whether the first job sends {"foo":"boo1"}