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

KEDA unable to access AmazonMQ ActiveMQ REST API #4440

Closed
yuvals41 opened this issue Apr 9, 2023 · 8 comments
Closed

KEDA unable to access AmazonMQ ActiveMQ REST API #4440

yuvals41 opened this issue Apr 9, 2023 · 8 comments
Labels
bug Something isn't working stale All issues that are marked as stale due to inactivity

Comments

@yuvals41
Copy link

yuvals41 commented Apr 9, 2023

Report

We're integrating KEDA into our EKS cluster and using AmazonMQ with the ActiveMQ engine. We're facing issues with KEDA not being able to access the ActiveMQ REST API. Whenever we try to access the Jolokia API endpoint (https://:8162/api/jolokia), we're being redirected to the main page.

Expected Behavior

keda will get the queue size and thus scale the pods

Actual Behavior

we get this error that the response probably is the main page
2023-04-09T15:37:16Z ERROR scale_handler error getting metric for scaler {"scaledObject.Namespace": "keda", "scaledObject.Name": "service-scaledobject", "scaler": "activeMQScaler", "error": "error inspecting ActiveMQ queue size: invalid character '<' looking for beginning of value"}

Steps to Reproduce the Problem

  1. open an amazonmq with activemq engine
  2. try to connect the keda pod inside an eks cluster to the activemq

Logs from KEDA operator

2023-04-09T15:37:16Z ERROR scale_handler error getting metric for scaler {"scaledObject.Namespace": "keda", "scaledObject.Name": "service-scaledobject", "scaler": "activeMQScaler", "error": "error inspecting ActiveMQ queue size: invalid character '<' looking for beginning of value"}

KEDA Version

2.10.0

Kubernetes Version

1.24

Platform

Amazon Web Services

Scaler Details

hpa

Anything else?

No response

@yuvals41 yuvals41 added the bug Something isn't working label Apr 9, 2023
@JorTurFer
Copy link
Member

hi,
Could you share your ScaledObject? I'm not an expert about ActiveMQ, but being redirected when you request https://xxxxxxx:8162/api/jolokia sound weird :/. Is your application able to access, or it doesn't access either?

@tomkerkhove
Copy link
Member

This might be because we do not support Amazon MQ yet, at least it's the first time I hear about it.

@tomkerkhove
Copy link
Member

Next to Jorge his question, would you mind sharing more logs please?

@tomkerkhove tomkerkhove moved this from To Triage to Proposed in Roadmap - KEDA Core Apr 26, 2023
@stale
Copy link

stale bot commented Jun 25, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Jun 25, 2023
@stale
Copy link

stale bot commented Jul 2, 2023

This issue has been automatically closed due to inactivity.

@stale stale bot closed this as completed Jul 2, 2023
@github-project-automation github-project-automation bot moved this from Proposed to Ready To Ship in Roadmap - KEDA Core Jul 2, 2023
@jalonsoa
Copy link

jalonsoa commented Feb 5, 2024

sorry .. any news on amazonmq support ? .. I can't see this issue in the roadmap.

@JorTurFer
Copy link
Member

sorry .. any news on amazonmq support ? .. I can't see this issue in the roadmap.

The issue was closed due to OP inactivity. I'd suggest creating another issue to track your case. Actually, it should work and the only info about now working is the issue but the OP didn't answer anything

@stv-io
Copy link

stv-io commented Jan 23, 2025

.. if this helps ..

AmazonMQ for ActiveMQ does not expose the api (I haven't found any official docs, but there was a clear mention of it in https://stackoverflow.com/questions/62474796/enable-jmx-for-amazon-mq)

An alternative approach for queue-based scaling, which uses the same metrics exposed from AmazonMQ via cloudwatch, would be to use the AWS cloudwatch scaler

The below worked for me. Granting the keda-operator cloudwatchmetrics:get permissions. It is relatively slow to react, to the default

apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
  name: aws-credentials
  namespace: activemq-keda-scaling
spec:
  podIdentity:
    provider: aws-eks
    identityOwner: keda
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: activemq-consumer-scaler
  namespace: activemq-keda-scaling
  labels:
    app: activemq-consumer
spec:
  scaleTargetRef:
    name: activemq-consumer
  maxReplicaCount: 200
  minReplicaCount: 1
  cooldownPeriod: 60
  pollingInterval: 30
  triggers:
    - type: aws-cloudwatch
      metadata:
        awsRegion: "eu-west-1"
        namespace: "AWS/AmazonMQ"
        metricName: "QueueSize"
        dimensionName: "Broker,Queue"
        dimensionValue: "prod-public-active-mq-2,load-testing-queue"
        targetMetricValue: "100"
        minMetricValue: "0"
        metricCollectionTime: "60"
        metricStatPeriod: "60"
        identityOwner: operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale All issues that are marked as stale due to inactivity
Projects
Archived in project
Development

No branches or pull requests

5 participants