001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.activemq.tool.properties;
018    
019    public class JmsProducerProperties extends JmsClientProperties {
020        public static final String TIME_BASED_SENDING  = "time"; // Produce messages base on a time interval
021        public static final String COUNT_BASED_SENDING = "count"; // Produce a specific count of messages
022        public static final String DELIVERY_MODE_PERSISTENT     = "persistent"; // Persistent message delivery
023        public static final String DELIVERY_MODE_NON_PERSISTENT = "nonpersistent"; // Non-persistent message delivery
024    
025        protected String deliveryMode = DELIVERY_MODE_NON_PERSISTENT; // Message delivery mode
026        protected int messageSize = 1024; // Send 1kb messages by default
027        protected long sendCount  = 1000000; // Send a million messages by default
028        protected long sendDuration = 5 * 60 * 1000; // Send for 5 mins by default
029        protected String sendType = TIME_BASED_SENDING;
030        // If true, create a different message on each send, otherwise reuse.
031        protected boolean createNewMsg; 
032    
033        public String getDeliveryMode() {
034            return deliveryMode;
035        }
036    
037        public void setDeliveryMode(String deliveryMode) {
038            this.deliveryMode = deliveryMode;
039        }
040    
041        public int getMessageSize() {
042            return messageSize;
043        }
044    
045        public void setMessageSize(int messageSize) {
046            this.messageSize = messageSize;
047        }
048    
049        public long getSendCount() {
050            return sendCount;
051        }
052    
053        public void setSendCount(long sendCount) {
054            this.sendCount = sendCount;
055        }
056    
057        public long getSendDuration() {
058            return sendDuration;
059        }
060    
061        public void setSendDuration(long sendDuration) {
062            this.sendDuration = sendDuration;
063        }
064    
065        public String getSendType() {
066            return sendType;
067        }
068    
069        public void setSendType(String sendType) {
070            this.sendType = sendType;
071        }
072    
073        public boolean isCreateNewMsg() {
074            return createNewMsg;
075        }
076    
077        public void setCreateNewMsg(boolean createNewMsg) {
078            this.createNewMsg = createNewMsg;
079        }
080    }