Giter VIP home page Giter VIP logo

xk6-amqp's Introduction

⚠️ Deprecated!!!

This extension was originally created as a proof of concept. At this time, there are no maintainers available to support this extension.

USE AT YOUR OWN RISK!


xk6-amqp

A k6 extension for publishing and consuming messages from queues and exchanges. This project utilizes AMQP 0.9.1, the most common AMQP protocol in use today.

⚠️ This project is not compatible with AMQP 1.0. A list of AMQP 1.0 brokers and other AMQP 1.0 resources may be found at github.com/xinchen10/awesome-amqp.

Build

To build a k6 binary with this extension, first ensure you have the prerequisites:

Then:

  1. Download xk6:
$ go install go.k6.io/xk6/cmd/xk6@latest
  1. Build the k6 binary:
$ xk6 build --with github.com/grafana/xk6-amqp@latest

Development

To make development a little smoother, use the Makefile in the root folder. The default target will format your code, run tests, and create a k6 binary with your local code rather than from GitHub.

git clone [email protected]:grafana/xk6-amqp.git
cd xk6-amqp
make

Example

import Amqp from 'k6/x/amqp';
import Queue from 'k6/x/amqp/queue';

export default function () {
  console.log("K6 amqp extension enabled, version: " + Amqp.version)
  const url = "amqp://guest:guest@localhost:5672/"
  Amqp.start({
    connection_url: url
  })
  console.log("Connection opened: " + url)

  const queueName = 'K6 general'

  Queue.declare({
    name: queueName,
    // durable: false,
    // delete_when_unused: false,
    // exclusive: false,
    // no_wait: false,
    // args: null
  })

  console.log(queueName + " queue is ready")

  Amqp.publish({
    queue_name: queueName,
    body: "Ping from k6",
    content_type: "text/plain"
    // timestamp: Math.round(Date.now() / 1000)
    // exchange: '',
    // mandatory: false,
    // immediate: false,
    // headers: {
    //   'header-1': '',
    // },
  })

  const listener = function(data) { console.log('received data: ' + data) }
  Amqp.listen({
    queue_name: queueName,
    listener: listener,
    // consumer: '',
    // auto_ack: true,
    // exclusive: false,
		// no_local: false,
		// no_wait: false,
    // args: null
  })
}

Result output:

$ ./k6 run script.js

          /\      |‾‾| /‾‾/   /‾‾/
     /\  /  \     |  |/  /   /  /
    /  \/    \    |     (   /   ‾‾\
   /          \   |  |\  \ |  (‾)  |
  / __________ \  |__| \__\ \_____/ .io

  execution: local
     script: ../xk6-amqp/examples/test.js
     output: -

  scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):
           * default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)

INFO[0000] K6 amqp extension enabled, version: v0.0.1    source=console
INFO[0000] Connection opened: amqp://guest:guest@localhost:5672/  source=console
INFO[0000] K6 general queue is ready                     source=console
INFO[0000] received data: Ping from k6                   source=console

running (00m00.0s), 0/1 VUs, 1 complete and 0 interrupted iterations
default ✓ [======================================] 1 VUs  00m00.0s/10m0s  1/1 iters, 1 per VU

     data_received........: 0 B 0 B/s
     data_sent............: 0 B 0 B/s
     iteration_duration...: avg=31.37ms min=31.37ms med=31.37ms max=31.37ms p(90)=31.37ms p(95)=31.37ms
     iterations...........: 1   30.855627/s

Inspect examples folder for more details.

Testing Locally

This repository includes a docker-compose.yml file that starts RabbitMQ with Management Plugin for testing the extension locally.

⚠️ This environment is intended for testing only and should not be used for production purposes.

  1. Start the docker compose environment.
    docker compose up -d
    Output should appear similar to the following:
    ✔ Network xk6-amqp_default       Created               ...    0.0s
    ✔ Container xk6-amqp-rabbitmq-1  Started               ...    0.2s
  2. Use your custom k6 binary to run a k6 test script connecting to your RabbitMQ server started in the previous step.
    ./k6 run examples/test.js
  3. Use the RabbitMQ admin console by accessing http://localhost:15672/, then login using guest for both the Username and Password. This will allow you to monitor activity within your messaging server.

xk6-amqp's People

Contributors

acuderman avatar adone avatar charobinvisa avatar javaducky avatar lxkuz avatar mstoykov avatar pablodelbarrioarnanz avatar swantzter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xk6-amqp's Issues

Amqp.start in setup function, can be used for all or other scenarios, only calling it once

I have just discovered and got working.

Using Amqp.start(); in a setup function, lets you then use Amqp.publish(); across multiple scenarios!

I have a run.js script which I have all my scenarios exported into etc, I call that with k6 run.

export function setup() {
  try {
    Amqp.start({
      connection_url: url,
    });
  } catch (err) {
    console.log(err);
  }
}

I have 3 functions which publish to 2 different queues, those functions are then set in the exec of a scenario.

Example function or test script:

import { uuidv4 } from "https://jslib.k6.io/k6-utils/1.4.0/index.js";
import { sleep } from "k6";
import { Counter } from "k6/metrics";
// @ts-ignore
import Amqp from "k6/x/amqp";
// @ts-ignore
import Queue from "k6/x/amqp/queue";

const myCounter = new Counter(
  "some_queue_count"
);

export const confirmationOfPayeeNewPayee = () => {
  try {
    const queueName =
      "some_queue";

    Queue.declare({
      name: queueName,
      durable: false,
      delete_when_unused: false,
      exclusive: false,
      no_wait: false,
      args: null,
    });

    console.log(queueName + " queue is ready");

    const accountNumber = Math.random().toString().slice(2, 10);
    const messageBody = {
      queue_name: queueName,
      body: `{
                    "id":"${uuidv4()}",
                    "account_id":"${uuidv4()}",
                    "house_account_id":"${uuidv4()}",
                    "virtual_account_id":"${uuidv4()}",
                    "account_number":"${accountNumber}",
                    "routing_code":"xxxxx",
                    "account_holder_name":"xxx",
                    "enabled":"1"
                }`,
      content_type: "application/json",
    };
    Amqp.publish(messageBody);
    myCounter.add(1);
    sleep(10);
  } catch (err) {
    console.log("Connection cop: " + err);
    sleep(10);
  }
};

I have a scenarios.js:

export let scenarios = {
  ConfirmationOfPayeeCreatePayeeScenario: {
    executor: "ramping-vus",
    exec: "confirmationOfPayeeNewPayee",
    stages: loadTest(vus.copPaye).stages,
  },
  NewFundsApprovedTransactionScenario: {
    executor: "ramping-vus",
    exec: "inboundTransactionCreateApproved",
    stages: loadTest(vus.newFundsTransactionApproved).stages,
  },
  NewFundsPendingTransactionScenario: {
    executor: "ramping-vus",
    exec: "inboundTransactionCreatePending",
    stages: loadTest(vus.newFundsTransactionPending).stages,
  },
};

The messages are successfully published for all scenarios :)

Tasks

No tasks being tracked yet.

Publish event with headers on exchange with routing key

I have noticed, that the extension does not allow headers to be set. Would It be possible to add an option as this would enable us to test our app as our queues rely on them?

Also is there an option to publish an event to an exchange with a routing key set, rather than directly to the queue? Looking at the options, the exchange can be defined, but not the routing key.

default panic: runtime error: invalid memory address or nil pointer dereference

Running code

import Amqp from 'k6/x/amqp';
import Queue from 'k6/x/amqp/queue';

export const options = {
    vus: 10,
    duration: '30s'
};


export default function () {
  console.log("K6 amqp extension enabled, version: " + Amqp.version)
  const url = "amqp://guest:guest@localhost:5672/"
  Amqp.start({
    connection_url: url
  })
  console.log("Connection opened: " + url)
  
  const queueName = 'K6 general'
  
  Queue.declare({
    name: queueName,
    // durable: false,
    // delete_when_unused: false,
    // exclusive: false,
    // no_wait: false,
    // args: null
  })

  console.log(queueName + " queue is ready")

  Amqp.publish({
    queue_name: queueName,
    body: "Ping from k6"
    // exchange: '',
    // mandatory: false,
    // immediate: false,
  })

  const listener = function(data) { console.log('received data: ' + data) }
  Amqp.listen({
    queue_name: queueName,
    listener: listener,
    // consumer: '',
    // auto_ack: true,
    // exclusive: false,
		// no_local: false,
		// no_wait: false,
    // args: null
  })
}

I'm getting an error

INFO[0000] K6 amqp extension enabled, version: v0.0.1    source=console
INFO[0000] K6 amqp extension enabled, version: v0.0.1    source=console
INFO[0000] K6 general queue is ready                     source=console
INFO[0000] K6 amqp extension enabled, version: v0.0.1    source=console
panic: runtime error: invalid memory address or nil pointer dereference [recovered]        
running panic: runtime error: invalid memory address or nil pointer dereference [recovered]
default panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x11fe10e]

goroutine 328 [running]:
github.com/dop251/goja.AssertFunction.func1.1()
        github.com/dop251/[email protected]/runtime.go:2154 +0x74
panic({0x1852c80, 0x25a9830})
        runtime/panic.go:1038 +0x215
github.com/dop251/goja.(*vm).try.func1()
        github.com/dop251/[email protected]/vm.go:511 +0x8eb
panic({0x1852c80, 0x25a9830})
        runtime/panic.go:1038 +0x215
github.com/dop251/goja.(*vm).run(0xc000e74300)
        github.com/dop251/[email protected]/vm.go:401 +0x4e
github.com/dop251/goja.(*baseJsFuncObject)._call(0xc0027cc160, {{0x1c06ce8, 0x261f1e0}, {0xc00059cf80, 0x1, 0x1}}, {0x0, 0x0}, {0x1c06ce8, 0x261f1e0})
        github.com/dop251/[email protected]/func.go:172 +0x2d8
github.com/dop251/goja.(*funcObject).call(...)
        github.com/dop251/[email protected]/func.go:180
github.com/dop251/goja.(*funcObject).Call(0x6a1d, {{0x1c06ce8, 0x261f1e0}, {0xc00059cf80, 0x1, 0x1}})
        github.com/dop251/[email protected]/func.go:140 +0xc9
github.com/dop251/goja.AssertFunction.func1.2()
        github.com/dop251/[email protected]/runtime.go:2159 +0x7d
github.com/dop251/goja.(*vm).try(0xd0d1b4, 0x10)
        github.com/dop251/[email protected]/vm.go:517 +0x1a4
github.com/dop251/goja.AssertFunction.func1({0x1c06ce8, 0x261f1e0}, {0xc00059cf80, 0xc0025e6520, 0x20001})
        github.com/dop251/[email protected]/runtime.go:2158 +0x110
github.com/dop251/goja.(*Runtime).wrapJSFunc.func1({0xc0012520a8, 0x1, 0x2})
        github.com/dop251/[email protected]/runtime.go:2027 +0x105
github.com/grafana/xk6-amqp.(*Amqp).Listen.func1()
        github.com/grafana/[email protected]/amqp.go:100 +0x107
created by github.com/grafana/xk6-amqp.(*Amqp).Listen
        github.com/grafana/[email protected]/amqp.go:98 +0x16c
PS C:\Users\lukasz.urbanski\prg_bs_local\performancetests>

GoError: Exception (501) Reason: "EOF"

HI, @javaducky!

At the very beginning of using your library, I encountered difficulties that I can't find an answer to. I took your very first example, changed only the url in it (even without changing it, I get an error, which is logical)(I use other letters, but their count and case match my original).

`import Amqp from 'k6/x/amqp';
import Queue from 'k6/x/amqp/queue';

export default function () {
console.log("K6 amqp extension enabled, version: " + Amqp.version)

const url = "amqp://qa:[email protected]:1414/"

Amqp.start({
    connection_url: url
})
console.log("Connection opened: " + url)

const queueName = 'K6 general'

Queue.declare({
    name: queueName,
    // durable: false,
    // delete_when_unused: false,
    // exclusive: false,
    // no_wait: false,
    // args: null
})

console.log(queueName + " queue is ready")

Amqp.publish({
    queue_name: queueName,
    body: "Ping from k6",
    content_type: "text/plain"
    // timestamp: Math.round(Date.now() / 1000)
    // exchange: '',
    // mandatory: false,
    // immediate: false,
    // headers: {
    //   'header-1': '',
    // },
})

const listener = function (data) { console.log('received data: ' + data) }
Amqp.listen({
    queue_name: queueName,
    listener: listener,
    // consumer: '',
    // auto_ack: true,
    // exclusive: false,
    // no_local: false,
    // no_wait: false,
    // args: null
})

}
`

But, alas, it doesn't work and I get an error like:

INFO[0000] K6 amqp extension enabled, version: v0.4.1 source=console ERRO[0002] GoError: Exception (501) Reason: "EOF" running at reflect.methodValueCall (native) default at file:///C:/Users/vxczvi/xczvzx/pvcxv/index.js:9:13(18) executor=per-vu-iterations scenario=default source=stacktrace

Yes, I saw issue #5, but I didn't find anything useful there for myself

Thank you very much for your help!

Request -> RPC Support

Context

We spoke via Slack about the desire to have RPC support in this extension and some of the things I've tried to do to add it in there. Here is some of that context copied:

Our main use-case is RPC tests.. "how many RPCs can I fire off until I start to see perf issues from the receivers of the RPCs?" is the main question for now. I think ideally we'd be able to provision an AMQP connection and set up reply handlers all outside of the tests. Inside the test we'd just want to ramp up / down the actual RPCs being made. The integration between the RPCs we fire and how to make the test pause for responses as well as make sure the metrics actually reflect what is going on is still very unclear.

WIP

The work in progress so far has been me trying to do some very basic things:

  • Add correlation ID and reply to support in the golang extension level
    • I.e. have the publish() method proxy those options through and then have listener expose them via some hacky string concatenation
  • Use the values above at the testing client level to basically transform the received payload and try to publish back to the reply to value with the same correlation ID

I mentioned in Slack the litany of issues I've ran into so far and how all of it is so confusing because the interaction between NodeJS and golang in the k6 system isn't clearly defined for me. As I try to make changes to do this work, the test will hang or fail fast or panic depending on what I'm trying to do.

I did publish a branch of this code to my fork and you can view that here: https://github.com/nathan-hega/xk6-amqp/tree/RPC-prototype (I hope it's viewable at least, been a long time actually using Github for me!)

In this example, you can see I try to edit the publish-listen.js test to fit my purposes / model what I'm trying to do. I hope the code aligns nicely with what I've been saying above. Please excuse the "WIP" / prototype nature (sloppy nature) of the code 😄 .

RPC Notes

I do have experience creating an RPC wrapper / implementation around the streadway/amqp library. If there is anything I can do to expose some of that to you for help here, please LMK. I can go over the high level RPC mechanics or paste snippets of the code I actually used. The library itself is proprietary under my company so I can't publish the entire thing unfortunately, though I have wondered if that package would be a better starting point for RPC support in this AMQP extension than going vanilla against streadway/amqp.

LMK!

Next Steps

For me, I have to take a break from this for a couple days. When I return, I have to basically decide for my company if we will move forward with this project one way or another. Moving forward could mean I either help you do RPCs in this extension or I make my own extension privately and do the same work there or I fork from this and just keep working independent of whatever you are focusing on.

I know you care little for my own personal timelines, etc.. but I figured I'd share this context so we are on the same page. Ideally, we can work together to make this extension great, but if that doesn't fit into my company's timelines, I'll have to adjust.


Thank you !! Even though the extension is in a very very early stage, it's been nice to have something to tinker around with and another human to talk to directly about these topics.

GoError: Exception (501) Reason: "EOF"

When I'm running Example script from README.md I'm getting an error:

          /\      |‾‾| /‾‾/   /‾‾/
     /\  /  \     |  |/  /   /  /
    /  \/    \    |     (   /   ‾‾\
   /          \   |  |\  \ |  (‾)  |
  / __________ \  |__| \__\ \_____/ .io

execution: local
script: index.js
output: -

scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):
* default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)

INFO[0000] K6 amqp extension enabled, version: v0.0.1 source=console
ERRO[0005] GoError: Exception (501) Reason: "EOF"
running at reflect.methodValueCall (native)
default at file:///C:/Users/lukasz.urbanski/prg_bs_local/performancetests/index.js:15:21(19) executor=per-vu-iterations scenario=default source=stacktrace

running (00m05.0s), 0/1 VUs, 1 complete and 0 interrupted iterations
default ✓ [======================================] 1 VUs 00m05.0s/10m0s 1/1 iters, 1 per VU

 data_received........: 0 B 0 B/s
 data_sent............: 0 B 0 B/s
 iteration_duration...: avg=5s min=5s med=5s max=5s p(90)=5s p(95)=5s
 iterations...........: 1   0.199311/s
 vus..................: 1   min=1      max=1
 vus_max..............: 1   min=1      max=1

Use event loop

This extension does make asynchronous use of the runtime which leads to panics as shown in #6 .

In the past I did some changes to make it better but those were never commited as were either using unstable APIs or were quite bad.

The latest one uses an early version of what is currently the event loop in k6.

I would argue that the API likely need changes as well, but at least moving to using the event loop will stop the panics and make it usable.

Address linter issues

With #11, we enabled the linter during CI. This issue is to address the pre-existing linting issues.

Facing issue while building xk6 binary

Hi @javaducky

I followed the steps given in the README #Build and ensured that my $PATH has the location /usr/local/go/bin but seems the system is unable to find xk6. Getting error

$ xk6 command not found

As asked I have also followed process in the README #Development but seems I am having the same issue. Require help in setting up xk6.

MicrosoftTeams-image

AMQP v1.0 is not supported

I am using ActiveMQ 5.15.x and this is unable to work due to incompatible version of AMQP used.

The error in console for k6 command is:

INFO[0000] K6 amqp extension enabled, version: v0.1.0    source=console
ERRO[0000] GoError: Exception (501) Reason: "Exception (501) Reason: \"frame could not be parsed\""
        at reflect.methodValueCall (native)
        at file:///D:/projects/xk6-amqp/xk6-amqp.js:9:25(19)  executor=per-vu-iterations scenario=default source=stacktrace

And there is warning in ActiveMQ console as well:

WARN | Connection attempt from non AMQP v1.0 client. AMQP,0,0,9,1
 WARN | Transport Connection to: tcp://0:0:0:0:0:0:0:1:63017 failed: org.apache.activemq.transport.amqp.AmqpProtocolException: Connection from client using unsupported AMQP attempted

per-VU connection/connection management

I'm trying to set up a test where I want to be publishing messages more like our real-life scenarios where say 100 connections are each publishing messages, but Amqp.start() seem to overwrite the connection globally meaning that I'll only be using the connection created by the last call to start?

I'd like to suggest that Amqp.start() returns a connection ID which can then be passed to the various functions to use that connection. For compat I'd suggest that the current behaviour is kept if no connection ID is included in the call

fatal error: concurrent map writes

Had this failure during a test,
cant really work out the cause

LOG:

fatal error: concurrent map writes
17:44:20
17:44:20 goroutine 184 [running]:
17:44:20 github.com/grafana/xk6-amqp.(*AMQP).Start(0xc0000d3ec0, {{0xc005a3a750?, 0x2?}})
17:44:20 github.com/grafana/[email protected]/amqp.go:84 +0xa5
17:44:20 reflect.Value.call({0x192b0c0?, 0xc0000d3ec0?, 0x0?}, {0x1b4c321, 0x4}, {0xc011597950, 0x1, 0x0?})
17:44:20 reflect/value.go:596 +0xce7
17:44:20 reflect.Value.Call({0x192b0c0?, 0xc0000d3ec0?, 0xc02b05bc50?}, {0xc011597950?, 0xc02d8129d0?, 0x0?})
17:44:20 reflect/value.go:380 +0xb9
17:44:20 github.com/dop251/goja.(*Runtime).newWrappedFunc.(*Runtime).wrapReflectFunc.func1({{0x1f63d90, 0xc003696420}, {0xc01f89c8b0, 0x1, 0x5}})
17:44:20 github.com/dop251/[email protected]/runtime.go:2056 +0x3bd
17:44:20 github.com/dop251/goja.(*nativeFuncObject).vmCall(0xc01f89c900, 0xc0017526c0, 0x1)
17:44:20 github.com/dop251/[email protected]/func.go:559 +0x186
17:44:20 github.com/dop251/goja.call.exec(0xe?, 0xc0017526c0)
17:44:20 github.com/dop251/[email protected]/vm.go:3366 +0x66
17:44:20 github.com/dop251/goja.(*vm).run(0xc0017526c0)
17:44:20 github.com/dop251/[email protected]/vm.go:582 +0x5b
17:44:20 github.com/dop251/goja.(*vm).runTryInner(0xc0017526c0?)
17:44:20 github.com/dop251/[email protected]/vm.go:834 +0x65
17:44:20 github.com/dop251/goja.(*baseJsFuncObject).__call(0xc0037b4e40, {0xc02d812980?, 0x1, 0xc009781748?}, {0x0?, 0x0}, {0x1f641b8?, 0x3022b20?})
17:44:20 github.com/dop251/[email protected]/func.go:426 +0x70f
17:44:20 github.com/dop251/goja.(*baseJsFuncObject)._call(...)
17:44:20 github.com/dop251/[email protected]/func.go:442
17:44:20 github.com/dop251/goja.(*baseJsFuncObject).call(0xc0097817a0?, {{0x1f641b8, 0x3022b20}, {0xc02d812980, 0x1, 0x1}}, {0x0?, 0x0?})
17:44:20 github.com/dop251/[email protected]/func.go:450 +0x76
17:44:20 github.com/dop251/goja.(*baseJsFuncObject).Call(...)
17:44:20 github.com/dop251/[email protected]/func.go:382
17:44:20 github.com/dop251/goja.AssertFunction.func1.1()
17:44:20 github.com/dop251/[email protected]/runtime.go:2476 +0x71
17:44:20 github.com/dop251/goja.(*vm).try(0xc0017526c0, 0xc0097a3980)
17:44:20 github.com/dop251/[email protected]/vm.go:811 +0x25b
17:44:20 github.com/dop251/goja.(*Runtime).runWrapped(0xc000b36000, 0x7f56884fb878?)
17:44:20 github.com/dop251/[email protected]/runtime.go:2520 +0x71
17:44:20 github.com/dop251/goja.AssertFunction.func1({0x1f641b8?, 0x3022b20?}, {0xc02d812980?, 0x1?, 0x1?})
17:44:20 github.com/dop251/[email protected]/runtime.go:2475 +0x8c
17:44:20 go.k6.io/k6/js.(*VU).runFn.func2.1()
17:44:20 go.k6.io/[email protected]/js/runner.go:848 +0x3e
17:44:20 go.k6.io/k6/js/eventloop.(*EventLoop).Start(0xc0010ada90, 0xc02b05bb30)
17:44:20 go.k6.io/[email protected]/js/eventloop/eventloop.go:177 +0x19a
17:44:20 go.k6.io/k6/js.(*VU).runFn.func2()
17:44:20 go.k6.io/[email protected]/js/runner.go:847 +0xdc
17:44:20 go.k6.io/k6/js/common.RunWithPanicCatching({0x1f696f0?, 0xc000083e80?}, 0xc0035ea3c0?, 0xc0097a3bd0?)
17:44:20 go.k6.io/[email protected]/js/common/util.go:86 +0x7c
17:44:20 go.k6.io/k6/js.(*VU).runFn(0xc0037737c0, {0x1f4af18, 0xc02ce98f00}, 0x60?, 0xc011597938, 0xc02d812960, {0xc02d812980, 0x1, 0x1})
17:44:20 go.k6.io/[email protected]/js/runner.go:846 +0x287
17:44:20 go.k6.io/k6/js.(*ActiveVU).RunOnce(0xc0015a1840)
17:44:20 go.k6.io/[email protected]/js/runner.go:788 +0x4de
17:44:20 go.k6.io/k6/lib/executor.(*RampingVUs).Run.getIterationRunner.func3({0x1f4af18, 0xc005723d60}, {0x1f39120?, 0xc0015a1840?})
17:44:20 go.k6.io/[email protected]/lib/executor/helpers.go:81 +0x4a
17:44:20 go.k6.io/k6/lib/executor.(*vuHandle).runLoopsIfPossible(0xc0035be120, 0xc000e6c0c0)
17:44:20 go.k6.io/[email protected]/lib/executor/vu_handle.go:205 +0xe3
17:44:20 created by go.k6.io/k6/lib/executor.(*rampingVUsRunState).runLoopsIfPossible in goroutine 341
17:44:20 go.k6.io/[email protected]/lib/executor/ramping_vus.go:612 +0xec
17:44:20
17:44:20 goroutine 1 [chan receive, 26 minutes]:
17:44:20 go.k6.io/k6/execution.(*Scheduler).Run(0xc003a7dc70, {0x1f4af18, 0xc00073d9a0}, {0x1f4aee0, 0xc000720600}, 0xc0054d7680)
17:44:20 go.k6.io/[email protected]/execution/scheduler.go:472 +0xc6e
17:44:20 go.k6.io/k6/cmd.(*cmdRun).run(0xc0008a4458, 0xc000940500, {0xc000932e00?, 0x1, 0x1f})
17:44:20 go.k6.io/[email protected]/cmd/run.go:352 +0x1531
17:44:20 github.com/spf13/cobra.(*Command).execute(0xc000940500, {0xc000932c00, 0x1f, 0x20})
17:44:20 github.com/spf13/[email protected]/command.go:856 +0x694
17:44:20 github.com/spf13/cobra.(*Command).ExecuteC(0xc000914780)
17:44:20 github.com/spf13/[email protected]/command.go:974 +0x38d
17:44:20 github.com/spf13/cobra.(*Command).Execute(...)
17:44:20 github.com/spf13/[email protected]/command.go:902
17:44:20 go.k6.io/k6/cmd.(*rootCommand).execute(0xc000703020)
17:44:20 go.k6.io/[email protected]/cmd/root.go:104 +0x125
17:44:20 go.k6.io/k6/cmd.Execute()
17:44:20 go.k6.io/[email protected]/cmd/root.go:137 +0x2f
17:44:20 main.main()
17:44:20 k6/main.go:12 +0xf

k6 0.45.1 issue on build

From 0.45.0 to 0.45.1 I have this issue:

2023/08/05 14:01:15 [INFO] Build environment ready
2023/08/05 14:01:15 [INFO] Building k6
2023/08/05 14:01:15 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -compat=1.17
2023/08/05 14:01:15 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /go/k6 -ldflags=-w -s -trimpath
# go.k6.io/k6/js/modules
/go/pkg/mod/go.k6.io/[email protected]/js/modules/resolution.go:161:20: source.URL.JoinPath undefined (type *url.URL has no field or method JoinPath)
note: module requires Go 1.19
2023/08/05 14:01:54 [INFO] Cleaning up temporary folder: /tmp/buildenv_2023-08-05-1400.2697366931
2023/08/05 14:01:54 [FATAL] exit status 2
The command '/bin/sh -c xk6 build --with github.com/grafana/xk6-amqp@latest' returned a non-zero code: 1

Unable to connect to ActiveMQ - GoError: Exception (501)

I need to connect to my activeMQ broker which is ssl enabled I am unable to do so . This is the error that I obtained .

GoError: Exception (501) Reason: "Exception (501) Reason: \"frame could not be parsed\""
running at reflect.methodValueCall (native)

What am I missing ?

Sending protobuf messages as binary data

Is there a way to send protobuf messages to RabbitMQ using this module?

Let's say I have a proto file that looks like this:

syntax = "proto3";
import "google/protobuf/timestamp.proto";
package performance.prototest;

message Simple {
  google.protobuf.Timestamp synced_at = 1;
}

and json data:

{
  "synced_at": "2023-02-03T12:23:11Z"
}

after encoding json into protobuf I'm getting javascript array: [10,6,8,175,249,243,158,6], but on xk6-amqp side it's transformed into [10 6 8 194 175 195 185 195 179 194 158 6] byte array.

One way I found is to use base64 encoding (with patching module to decode base64 before sending), but would be good to be able to send binary data.

replyTo not being passed in publish

When calling amqp.publish() I am receiving an error from RabbitMQ that my message is missing the reply_to property.
Here is what I have as my publisher:

const publish = function () {
    amqp.publish({
      queue_name: queueName,
      body: myBody,
      replyTo: myReplyQueue,
      messageId: uniqueID,
      correlationId: uniqueID,
      content_type: "text/plain",
    });
  };

publish()

I have also tried passing the publish option as reply_to and ReplyTo but to no avail 🥲

Allow setting further message properties

Today it's only possible to set message ContentType, and DeliveryMode, but to create realistic scenarios in our environment we need to be able to populate further message properties supported by the underlying Go library, for us it's at least: MessageId, CorrelationId, Type, AppId, Timestamp, UserId, ReplyTo.

Needed to maintain listing in k6 Extensions Registry

We've recently updated the requirements for maintaining an extension within the listing on our site. As such, please address the following items to maintain your listing within the registry:

  • needs to build with a recent version of k6; minimum v0.43 but v0.45 would be great...

For more information on these and other listing requirements, please take a look at the registry requirements.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.