// Path: camel-spring-mqtt/src/main/java/org/darugna/camel/mqtt/dto/Greeting.java
// public class Greeting {
// 
//     @Expose
//     private String greeting;
//     @Expose
//     private LocalDateTime greetingDate;
//     @Expose
//     private Map<String,Integer> recipients;
// 
//     // keep away from marshalling
//     private String toStringRepr;
// 
//     public String getGreeting() {
//         return greeting;
//     }
// 
//     public void setGreeting(String greeting) {
//         this.greeting = greeting;
//     }
// 
//     public LocalDateTime getGreetingDate() {
//         return greetingDate;
//     }
// 
//     public void setGreetingDateTime(LocalDateTime greetingDate) {
//         this.greetingDate = greetingDate;
//     }
// 
//     public Map<String, Integer> getRecipients() {
//         return recipients;
//     }
// 
//     public void setRecipients(Map<String, Integer> recipients) {
//         this.recipients = recipients;
//     }
//     
//     public void addRecipient(String recipient, Integer numberOfGreets) {
//         if (recipients == null) {
//             recipients = new HashMap<>();
//         }
//         recipients.put(recipient, numberOfGreets);
//     }
//     
//     @Override
//     public String toString() {
//         if (toStringRepr == null) {
//             final StringBuilder sb = new StringBuilder();
//             sb.append("On ").append(greetingDate)
//                     .append(" I said '").append(greeting).append("' to:");
//             recipients.keySet().forEach(k -> {
//                 sb.append(" ").
//                         append(k).append(" ")
//                         .append(recipients.get(k))
//                         .append(" times.");
//             });
//             toStringRepr = sb.toString();
//         }
//         return toStringRepr;
//     }
// 
// }


import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Random;
import java.util.stream.IntStream;
import org.darugna.camel.mqtt.dto.Greeting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
package org.darugna.camel.mqtt;


public class GreetingProducerBean {

    private final static Logger log = LoggerFactory.getLogger(GreetingProducerBean.class);
    
    private final Random random = new Random();
    
    // List of greetings. Original writings taken from Wikipedia.
    private final String[] GREETINGS = {
        "Hello!",
        "Good morning",
        "Ciao",
        "Salaam (سَلَام)",
        "Namaste (नमस्ते)",
        "Konnichiwa (今日は)"
    };
    
    private final String[] NAMES = {
        "Alessandro",
        "Pete",
        "Amit",
        "Dracula"
    };
    
    public Greeting produce() {
// Path: camel-spring-mqtt/src/main/java/org/darugna/camel/mqtt/dto/Greeting.java
// public class Greeting {
// 
//     @Expose
//     private String greeting;
//     @Expose
//     private LocalDateTime greetingDate;
//     @Expose
//     private Map<String,Integer> recipients;
// 
//     // keep away from marshalling
//     private String toStringRepr;
// 
//     public String getGreeting() {
//         return greeting;
//     }
// 
//     public void setGreeting(String greeting) {
//         this.greeting = greeting;
//     }
// 
//     public LocalDateTime getGreetingDate() {
//         return greetingDate;
//     }
// 
//     public void setGreetingDateTime(LocalDateTime greetingDate) {
//         this.greetingDate = greetingDate;
//     }
// 
//     public Map<String, Integer> getRecipients() {
//         return recipients;
//     }
// 
//     public void setRecipients(Map<String, Integer> recipients) {
//         this.recipients = recipients;
//     }
//     
//     public void addRecipient(String recipient, Integer numberOfGreets) {
//         if (recipients == null) {
//             recipients = new HashMap<>();
//         }
//         recipients.put(recipient, numberOfGreets);
//     }
//     
//     @Override
//     public String toString() {
//         if (toStringRepr == null) {
//             final StringBuilder sb = new StringBuilder();
//             sb.append("On ").append(greetingDate)
//                     .append(" I said '").append(greeting).append("' to:");
//             recipients.keySet().forEach(k -> {
//                 sb.append(" ").
//                         append(k).append(" ")
//                         .append(recipients.get(k))
//                         .append(" times.");
//             });
//             toStringRepr = sb.toString();
//         }
//         return toStringRepr;
//     }
// 
// }


// Path: camel-spring-mqtt/src/main/java/org/darugna/camel/mqtt/GreetingProducerBean.java
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Random;
import java.util.stream.IntStream;
import org.darugna.camel.mqtt.dto.Greeting;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

package org.darugna.camel.mqtt;


public class GreetingProducerBean {

    private final static Logger log = LoggerFactory.getLogger(GreetingProducerBean.class);
    
    private final Random random = new Random();
    
    // List of greetings. Original writings taken from Wikipedia.
    private final String[] GREETINGS = {
        "Hello!",
        "Good morning",
        "Ciao",
        "Salaam (سَلَام)",
        "Namaste (नमस्ते)",
        "Konnichiwa (今日は)"
    };
    
    private final String[] NAMES = {
        "Alessandro",
        "Pete",
        "Amit",
        "Dracula"
    };
    
    public Greeting produce() {
        Greeting g = new Greeting();