
ru.tinkoff.gatling.amqp.request.RequestReplyDslBuilderMessage.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gatling-amqp-plugin_2.13 Show documentation
Show all versions of gatling-amqp-plugin_2.13 Show documentation
Plugin for support performance testing with AMQP in Gatling
The newest version!
package ru.tinkoff.gatling.amqp.request
import io.gatling.core.config.GatlingConfiguration
import io.gatling.core.session.Expression
import ru.tinkoff.gatling.amqp.action.RequestReplyBuilder
import java.nio.charset.Charset
case class RequestReplyDslBuilderMessage(
requestName: Expression[String],
destination: AmqpExchange,
replyDest: AmqpExchange,
setReplyTo: Boolean,
messageSelector: Option[String],
configuration: GatlingConfiguration,
) {
/** Add a reply queue
*/
def replyExchange(name: Expression[String]): RequestReplyDslBuilderMessage = replyDestination(AmqpQueueExchange(name))
private def replyDestination(destination: AmqpExchange) = this.copy(replyDest = destination)
def noReplyTo: RequestReplyDslBuilderMessage = this.copy(setReplyTo = false)
def textMessage(text: Expression[String], charset: Charset = configuration.core.charset): RequestReplyDslBuilder =
message(TextAmqpMessage(text, charset))
def bytesMessage(bytes: Expression[Array[Byte]]): RequestReplyDslBuilder = message(BytesAmqpMessage(bytes))
private def message(mess: AmqpMessage) =
RequestReplyDslBuilder(
AmqpAttributes(requestName, destination, messageSelector, mess),
RequestReplyBuilder(_, replyDest, setReplyTo, configuration),
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy