alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

ActiveMQ example source code file (JmsProducerProperties.java)

This example ActiveMQ source code file (JmsProducerProperties.java) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - ActiveMQ tags/keywords

count_based_sending, delivery_mode_non_persistent, delivery_mode_non_persistent, delivery_mode_persistent, jmsclientproperties, jmsproducerproperties, message, produce, produce, send, send, string, string, time_based_sending

The ActiveMQ JmsProducerProperties.java source code

/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.activemq.tool.properties;

public class JmsProducerProperties extends JmsClientProperties {
    public static final String TIME_BASED_SENDING  = "time"; // Produce messages base on a time interval
    public static final String COUNT_BASED_SENDING = "count"; // Produce a specific count of messages
    public static final String DELIVERY_MODE_PERSISTENT     = "persistent"; // Persistent message delivery
    public static final String DELIVERY_MODE_NON_PERSISTENT = "nonpersistent"; // Non-persistent message delivery

    protected String deliveryMode = DELIVERY_MODE_NON_PERSISTENT; // Message delivery mode
    protected int messageSize = 1024; // Send 1kb messages by default
    protected long sendCount  = 1000000; // Send a million messages by default
    protected long sendDuration = 5 * 60 * 1000; // Send for 5 mins by default
    protected String sendType = TIME_BASED_SENDING;
    protected long sendDelay = 0;  // delay in milliseconds between each producer send
    
    // If true, create a different message on each send, otherwise reuse.
    protected boolean createNewMsg; 

    public String getDeliveryMode() {
        return deliveryMode;
    }

    public void setDeliveryMode(String deliveryMode) {
        this.deliveryMode = deliveryMode;
    }

    public int getMessageSize() {
        return messageSize;
    }

    public void setMessageSize(int messageSize) {
        this.messageSize = messageSize;
    }

    public long getSendCount() {
        return sendCount;
    }

    public void setSendCount(long sendCount) {
        this.sendCount = sendCount;
    }

    public long getSendDuration() {
        return sendDuration;
    }

    public void setSendDuration(long sendDuration) {
        this.sendDuration = sendDuration;
    }

    public String getSendType() {
        return sendType;
    }

    public void setSendType(String sendType) {
        this.sendType = sendType;
    }

    public boolean isCreateNewMsg() {
        return createNewMsg;
    }

    public void setCreateNewMsg(boolean createNewMsg) {
        this.createNewMsg = createNewMsg;
    }
    
    public void setSendDelay(long delay) {
    	this.sendDelay = delay;
    }
    
    public long getSendDelay() {
    	return this.sendDelay;
    }
}

Other ActiveMQ examples (source code examples)

Here is a short list of links related to this ActiveMQ JmsProducerProperties.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.