<commit_before>package com.frontend;

import com.frontend.zipkin.ZipkinConfiguration;
import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.LoadBalancerBuilder;
import com.netflix.loadbalancer.Server;
import com.netflix.loadbalancer.WeightedResponseTimeRule;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.core.JmsTemplate;

import javax.jms.Queue;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Import(ZipkinConfiguration.class)
@SpringBootApplication
@EnableJms
@Configuration
@RibbonClient(name = "ribbon-backend", configuration = FrontendAppMain.class)
public class FrontendAppMain {

    public static void main(String[] args) {
		SpringApplication.run(FrontendAppMain.class, args);
    }

    @Bean
    ILoadBalancer ribbon() {
        List<Server> servers = Arrays.asList(
            new Server("localhost:8988")//,
//            new Server("localhost:8987")
        );

        return LoadBalancerBuilder.newBuilder()
                .withRule(new WeightedResponseTimeRule())
                .buildFixedServerListLoadBalancer(servers);
    }

    @Bean
    JmsTemplate jmsTemplate() {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        JmsTemplate template = new JmsTemplate();
        template.setConnectionFactory(connectionFactory);
        return template;
    }

    // Uncomment when Zipkin configuration is disabled<commit_msg>Restored ribbon<commit_after>package com.frontend;

import com.frontend.zipkin.ZipkinConfiguration;
import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.LoadBalancerBuilder;
import com.netflix.loadbalancer.Server;
import com.netflix.loadbalancer.WeightedResponseTimeRule;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.core.JmsTemplate;

import javax.jms.Queue;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Import(ZipkinConfiguration.class)
@SpringBootApplication
@EnableJms
@Configuration
@RibbonClient(name = "ribbon-backend", configuration = FrontendAppMain.class)
public class FrontendAppMain {

    public static void main(String[] args) {
		SpringApplication.run(FrontendAppMain.class, args);
    }

    @Bean
    ILoadBalancer ribbon() {
        List<Server> servers = Arrays.asList(
            new Server("localhost:8988"),
            new Server("localhost:8987")
        );

        return LoadBalancerBuilder.newBuilder()
                .withRule(new WeightedResponseTimeRule())
                .buildFixedServerListLoadBalancer(servers);
    }

    @Bean
    JmsTemplate jmsTemplate() {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        JmsTemplate template = new JmsTemplate();
        template.setConnectionFactory(connectionFactory);
        return template;
    }

    // Uncomment when Zipkin configuration is disabled
{'fraction_non_alphanumeric': 0.09149676777722526, 'fraction_numerical': 0.006464445549477871, 'mean_word_length': 4.747142857142857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1694658', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1079, 'n_words': 190}