Hotswap configuration files in Jira Plugins - like Apache Felix

Tormod Haugene October 29, 2018

In the Apache Felix framework that Jira runs on, there is a concept that allows you to define configuration files with hotswap functionality. Is this somehow possible to achieve in Jira Plugins as well?

Example from Karaf

In Karaf - which also is based on Apache Felix - this works by annotating Spring/Blueprint components with a configuration class, such as:

@Component(name="MyComponent")
@Designate(ocd = MyConfig.class)
public class MyComponentImpl implements MyComponent {

@Activate
public void activate(MyConfig config) {
// Do something with the config object
AssertTrue(config.getUsername() == "username")
}

}

Then define that configuration class with some default values:

@ObjectClassDefinition(name = "MyConfigFileName")
@interface MyConfig {

String username() default "username";
String password() default "password";

}

If you then drop a file named `MyConfigFileName.cfg` into the folder `karafhome/etc`, the Apache Felix framework will reload all Spring components (here `MyComponent`) that use the `MyConfig` configuration, and update it's values:

# MyConfigFileName.cfg

username = helloWorld
password = h3110W0rld!

 

Is this possible in Jira?

From what I understand, the functionality described above should be possible to achieve in Jira as well, but the question is: how? If we import the Maven dependency required for the annotations and give it a spin, which folder should configurations be added to?

 

1 answer

1 vote
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 29, 2018

No, it reads config at startup and caches most of it.

Tormod Haugene October 29, 2018

Thanks for your answer, Nic! Do you know if there are any unofficial ways of doing this?

I imagine that if Jira runs on top of Felix, then this should be possible. However, for all I know Jira could be a wrapper for the entire Felix framework, which would complicate things.

The reason why I'm asking is because not having the ability to hot-swap configuration makes it much more difficult for our DevOps team, and we would rather not implement a custom solution if we don't have to.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 30, 2018

Not that I'm aware of, it's just not coded for.  Because once your Jira is configured correctly on a system level, you should not be messing with it.  It's rare to need to change the system files, they're definitely not things you should be "hot swapping"

Suggest an answer

Log in or Sign up to answer