Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

EventPublisher, spring-scanner and remote bamboo agents

Deleted user January 21, 2018

I am attempting to integrate into an existing plugin in order to send e-mails based on some internal business logic using Atlassian's EventPublisher API which I am wiring from atlassian-spring-scanner v1 API.

Using the latest Atlassian sdk, I was successfully create a plugin in order to do so on a local build agent.  Unfortunately, when I attempted to do the same thing on a remote build agent, I was unable to do so.

INFO | jvm 2 | 2018/01/21 21:28:54 | 2018-01-21 21:28:54,256 ERROR [remoteEventRebroadcasterMessageListenerContainer-1] [OsgiPlugin] Plugin 'com.hidden.notifications' never resolved service '&eventPublisher' with filter '(&(objectClass=com.atlassian.event.api.EventPublisher)(objectClass=com.atlassian.event.api.EventPublisher))'

I'm pretty sure my issue is as described in the following post which states that this API (and ApplicationProperties which I also tested) are not available on the remote agent classpath.

https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-fix-my-addon-not-running-on-remote-agent-because-waiting/qaq-p/493627

Unfortunately, the work arounds mentioned will not work for me since I can't just pipe the data -- I need to use the capabilities of the EventPublisher API to send e-mails.  I also can't create a custom EventListener to run on a local agent as I am dependent on deployment events which I don't believe Bamboo supports.  Even if it does, I'd rather not go down this path as the business logic for sending e-mails would be dependent on several runtime variables.

Is there any other work around for what I would imagine could be a fairly common usecase in order to send e-mails using Atlassian's EventPublisher API from remote agents.  My last resort was to create my own service.  Thank you.

1 answer

0 votes
Deleted user January 21, 2018

UPDATE:  This turned out to be a firewall issue so my work around for using a separate e-mail service does work.  I'd still prefer to use Atlassian's EventPublisher API if at all possible from a remote agent.

I also ran into issue when attempted to create a separate e-mail service using the javax.mail.api.  This works fine locally but when running from the remote agent I see this.  I did verify that the bamboo server has connectivity to the SMTP server so perhaps the remote agent is blocking port 25.

simple 22-Jan-2018 00:17:33 Deployment notifications failed due to: com.hidden.cf.services.org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: hidden.com, 25; timeout -1; nested exception is: java.net.ConnectException: Connection timed out (Connection timed out). Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: hidden.com, 25; timeout -1; nested exception is: java.net.ConnectException: Connection timed out (Connection timed out); message exceptions (1) are:Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: hidden.com, 25; timeout -1; nested exception is: java.net.ConnectException: Connection timed out (Connection timed out)

My next step which I am very reluctant to do is to create a REST API which would run on the main bamboo service to accept e-mails sent via JSON from the remote agents.  Please tell me there is an easier way.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events