SpringBootAdminApplication.java 1.63 KB
Newer Older
Thomas Bosch committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright 2014 the original author or authors.
 *
 * Licensed 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.
 */
Thomas Bosch committed
16
package de.codecentric.boot.admin;
Thomas Bosch committed
17 18 19

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
20
import org.springframework.context.annotation.Bean;
Thomas Bosch committed
21
import org.springframework.context.annotation.Configuration;
22 23 24 25 26

import com.hazelcast.config.Config;
import com.hazelcast.config.EvictionPolicy;
import com.hazelcast.config.ListConfig;
import com.hazelcast.config.MapConfig;
Thomas Bosch committed
27

Dennis Schulte committed
28
import de.codecentric.boot.admin.config.EnableAdminServer;
Thomas Bosch committed
29 30 31

@Configuration
@EnableAutoConfiguration
Dennis Schulte committed
32 33
@EnableAdminServer
public class SpringBootAdminApplication {
34 35 36 37 38
	@Bean
	public Config hazelcastConfig() {
		return new Config().setProperty("hazelcast.jmx", "true")
				.addMapConfig(new MapConfig("spring-boot-admin-application-store").setBackupCount(1)
						.setEvictionPolicy(EvictionPolicy.NONE))
Johannes Edmeier committed
39 40
				.addListConfig(new ListConfig("spring-boot-admin-event-store").setBackupCount(1)
						.setMaxSize(1000));
41
	}
Thomas Bosch committed
42 43

	public static void main(String[] args) {
Dennis Schulte committed
44
		SpringApplication.run(SpringBootAdminApplication.class, args);
Thomas Bosch committed
45 46
	}
}