Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] BugFix and Updates for Artemis ActiveMQ scaler #986

Merged
merged 4 commits into from
Aug 11, 2020
Merged

[v2] BugFix and Updates for Artemis ActiveMQ scaler #986

merged 4 commits into from
Aug 11, 2020

Conversation

spoplavskiy
Copy link
Contributor

@spoplavskiy spoplavskiy commented Aug 11, 2020

This PR has fixes for a bugs I faced with during deployment and setting up a scaler.

Also, I want to introduce additional metadata parameter "restApiTemplate" that address the following problem:
As of now, REST API url to get a queue size is hardcoded and looks like this:

"http://<<managementEndpoint>>/console/jolokia/read/org.apache.activemq.artemis:broker=\"<<brokerName>>\",component=addresses,address=\"<<brokerAddress>>\",subcomponent=queues,routing-type=\"anycast\",queue=\"<<queueName>>\"/MessageCount"

But there can be a cases, when a template is different. As an example, my endpoint looks like this:

"http://<<managementEndpoint>>/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=<<brokerName>>,destinationType=Queue,destinationName=<<queueName>>/QueueSize"

There is other examples of different endpoints for same api:
https://gist.github.com/yashpatil/de7437522bfccfeee4cb
https://activemq.apache.org/rest

To make this scaler more universal, "restApiTemplate" can be used to change a default REST endpoint.
Example value:
"http://<<managementEndpoint>>/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=<<brokerName>>,destinationType=Queue,destinationName=<<queueName>>/QueueSize"

<<managementEndpoint>>, <<brokerName>> and <<queueName>> will be automatically replaced by values from metadata in a runtime.

This parameter doesn't break existing logic: if "restApiTemplate" is not specified, a default one will be used, which is the same, as it was before.

Checklist

Fixes #

  • BugFix: Username and Password is empty
  • BugFix: Invalid argument when logging
  • [v2] Added "artemis-queue" scaler to list of scalers for v2

Feature #

  • Feature: Introduce optional metadata patameter "restApiTemplate" to be able to finetune ActiveMQ endpoint

Docks #222

Signed-off-by: Sergiy Poplavskyi spopla@microsoft.com

This fix allows to use a scaler definition without kubernetes secret, passing username and password in scaler metadata according to documentation for scaler

Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
This fix address an "invalid argument" exception, that throwing any time, when this line executed.

Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
…e able to finetune ActiveMQ endpoint

In different versions (or configurations) ActiveMQ REST andpoint can be different, than hardcoded in this scaler. To be able to finetune it, I have introduced an optional parameter to change this template.

Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
For some reason, ActiveMQ scaler wasn't added to v2. This commit will fix it.

Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
@spoplavskiy spoplavskiy changed the title V2 BugFix and Updates for Artemis ActiveMQ scaler Aug 11, 2020
@zroubalik
Copy link
Member

@spoplavskiy good catch, thanks! Could you please open another PR on kedacore/keda-docs repo and add documentation for the feature you have implemented?

The scaler docs for v2 are in this file:
https://github.com/kedacore/keda-docs/blob/master/content/docs/2.0/scalers/artemis.md

@zroubalik zroubalik changed the title BugFix and Updates for Artemis ActiveMQ scaler [v2] BugFix and Updates for Artemis ActiveMQ scaler Aug 11, 2020
@spoplavskiy
Copy link
Contributor Author

@spoplavskiy good catch, thanks! Could you please open another PR on kedacore/keda-docs repo and add documentation for the feature you have implemented?

The scaler docs for v2 are in this file:
https://github.com/kedacore/keda-docs/blob/master/content/docs/2.0/scalers/artemis.md

@zroubalik , thanks for advice.
I have created PR #222 in docs repo for v2

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@zroubalik zroubalik merged commit 14ff6ff into kedacore:v2 Aug 11, 2020
preflightsiren pushed a commit to preflightsiren/keda that referenced this pull request Nov 7, 2021
…#986 (kedacore#222)

- Changed "scaleTargetRef" definition example according to V2
- Added metadata paramer "restApiTemplate", that introduced in PR: kedacore#986

Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants