Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-boot-admin
Commits
28309bec
Commit
28309bec
authored
Mar 02, 2018
by
Johannes Edmeier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the hazelcast sample
parent
e66f115d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
12 deletions
+22
-12
SpringBootAdminApplication.java
...de/codecentric/boot/admin/SpringBootAdminApplication.java
+5
-7
SpringBootAdminApplication.java
...de/codecentric/boot/admin/SpringBootAdminApplication.java
+5
-0
Instance.java
...decentric/boot/admin/server/domain/entities/Instance.java
+2
-1
SnapshottingInstanceRepository.java
...erver/domain/entities/SnapshottingInstanceRepository.java
+5
-1
ConcurrentMapEventStore.java
...boot/admin/server/eventstore/ConcurrentMapEventStore.java
+3
-1
AdminServerNotifierConfigurationTest.java
...n/server/config/AdminServerNotifierConfigurationTest.java
+1
-1
InstanceTest.java
...ntric/boot/admin/server/domain/entities/InstanceTest.java
+1
-1
No files found.
spring-boot-admin-samples/spring-boot-admin-sample-hazelcast/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java
View file @
28309bec
...
@@ -29,7 +29,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
...
@@ -29,7 +29,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import
org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
;
import
org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler
;
import
com.hazelcast.config.Config
;
import
com.hazelcast.config.Config
;
import
com.hazelcast.config.EvictionPolicy
;
import
com.hazelcast.config.EvictionPolicy
;
import
com.hazelcast.config.
ListConfig
;
import
com.hazelcast.config.
InMemoryFormat
;
import
com.hazelcast.config.MapConfig
;
import
com.hazelcast.config.MapConfig
;
// tag::application-hazelcast[]
// tag::application-hazelcast[]
...
@@ -39,12 +39,10 @@ import com.hazelcast.config.MapConfig;
...
@@ -39,12 +39,10 @@ import com.hazelcast.config.MapConfig;
public
class
SpringBootAdminApplication
{
public
class
SpringBootAdminApplication
{
@Bean
@Bean
public
Config
hazelcastConfig
()
{
public
Config
hazelcastConfig
()
{
return
new
Config
().
setProperty
(
"hazelcast.jmx"
,
"true"
)
MapConfig
mapConfig
=
new
MapConfig
(
"spring-boot-admin-event-store"
).
setInMemoryFormat
(
InMemoryFormat
.
OBJECT
)
.
addMapConfig
(
new
MapConfig
(
"spring-boot-admin-application-eventstore"
).
setBackupCount
(
1
)
.
setBackupCount
(
1
)
.
setEvictionPolicy
(
.
setEvictionPolicy
(
EvictionPolicy
.
NONE
);
EvictionPolicy
.
NONE
))
return
new
Config
().
setProperty
(
"hazelcast.jmx"
,
"true"
).
addMapConfig
(
mapConfig
);
.
addListConfig
(
new
ListConfig
(
"spring-boot-admin-event-eventstore"
).
setBackupCount
(
1
).
setMaxSize
(
1000
));
}
}
@Profile
(
"insecure"
)
@Profile
(
"insecure"
)
...
...
spring-boot-admin-samples/spring-boot-admin-sample-war/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java
View file @
28309bec
...
@@ -19,6 +19,7 @@ package de.codecentric.boot.admin;
...
@@ -19,6 +19,7 @@ package de.codecentric.boot.admin;
import
de.codecentric.boot.admin.server.config.AdminServerProperties
;
import
de.codecentric.boot.admin.server.config.AdminServerProperties
;
import
de.codecentric.boot.admin.server.config.EnableAdminServer
;
import
de.codecentric.boot.admin.server.config.EnableAdminServer
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
import
org.springframework.boot.web.servlet.support.SpringBootServletInitializer
;
...
@@ -76,4 +77,8 @@ public class SpringBootAdminApplication extends SpringBootServletInitializer {
...
@@ -76,4 +77,8 @@ public class SpringBootAdminApplication extends SpringBootServletInitializer {
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SpringBootAdminApplication
.
class
,
args
);
}
}
}
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/entities/Instance.java
View file @
28309bec
...
@@ -168,7 +168,8 @@ public class Instance implements Serializable {
...
@@ -168,7 +168,8 @@ public class Instance implements Serializable {
private
Instance
apply
(
InstanceEvent
event
,
boolean
isNewEvent
)
{
private
Instance
apply
(
InstanceEvent
event
,
boolean
isNewEvent
)
{
Assert
.
notNull
(
event
,
"'event' must not be null"
);
Assert
.
notNull
(
event
,
"'event' must not be null"
);
Assert
.
isTrue
(
this
.
id
.
equals
(
event
.
getInstance
()),
"'event' must refer the same instance"
);
Assert
.
isTrue
(
this
.
id
.
equals
(
event
.
getInstance
()),
"'event' must refer the same instance"
);
Assert
.
isTrue
(
this
.
nextVersion
()
==
event
.
getVersion
(),
"expected event version doesn't match"
);
Assert
.
isTrue
(
this
.
nextVersion
()
==
event
.
getVersion
(),
()
->
"Event "
+
event
.
getVersion
()
+
" doesn't match exptected version "
+
this
.
nextVersion
());
List
<
InstanceEvent
>
unsavedEvents
=
appendToEvents
(
event
,
isNewEvent
);
List
<
InstanceEvent
>
unsavedEvents
=
appendToEvents
(
event
,
isNewEvent
);
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/domain/entities/SnapshottingInstanceRepository.java
View file @
28309bec
...
@@ -64,7 +64,11 @@ public class SnapshottingInstanceRepository extends EventsourcingInstanceReposit
...
@@ -64,7 +64,11 @@ public class SnapshottingInstanceRepository extends EventsourcingInstanceReposit
}
}
public
void
start
()
{
public
void
start
()
{
this
.
subscription
=
Flux
.
from
(
getEventStore
()).
doOnNext
(
this
::
updateSnapshot
).
retryWhen
(
retryOnAny
).
subscribe
();
this
.
subscription
=
getEventStore
().
findAll
()
.
concatWith
(
getEventStore
())
.
doOnNext
(
this
::
updateSnapshot
)
.
retryWhen
(
retryOnAny
)
.
subscribe
();
}
}
public
void
stop
()
{
public
void
stop
()
{
...
...
spring-boot-admin-server/src/main/java/de/codecentric/boot/admin/server/eventstore/ConcurrentMapEventStore.java
View file @
28309bec
...
@@ -102,9 +102,11 @@ public abstract class ConcurrentMapEventStore extends InstanceEventPublisher imp
...
@@ -102,9 +102,11 @@ public abstract class ConcurrentMapEventStore extends InstanceEventPublisher imp
}
}
if
(
eventLog
.
replace
(
id
,
oldEvents
,
newEvents
))
{
if
(
eventLog
.
replace
(
id
,
oldEvents
,
newEvents
))
{
log
.
debug
(
"Events
saved
{}"
,
events
);
log
.
debug
(
"Events
appended to log
{}"
,
events
);
return
true
;
return
true
;
}
}
log
.
debug
(
"Unsuccessful attempot append the events {} "
,
events
);
return
false
;
return
false
;
}
}
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/config/AdminServerNotifierConfigurationTest.java
View file @
28309bec
...
@@ -50,7 +50,7 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
...
@@ -50,7 +50,7 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
public
class
AdminServerNotifierConfigurationTest
{
public
class
AdminServerNotifierConfigurationTest
{
private
static
final
InstanceEvent
APP_DOWN
=
new
InstanceStatusChangedEvent
(
InstanceId
.
of
(
"id-2"
),
1
L
,
private
static
final
InstanceEvent
APP_DOWN
=
new
InstanceStatusChangedEvent
(
InstanceId
.
of
(
"id-2"
),
0
L
,
StatusInfo
.
ofDown
());
StatusInfo
.
ofDown
());
private
AnnotationConfigApplicationContext
context
;
private
AnnotationConfigApplicationContext
context
;
...
...
spring-boot-admin-server/src/test/java/de/codecentric/boot/admin/server/domain/entities/InstanceTest.java
View file @
28309bec
...
@@ -135,7 +135,7 @@ public class InstanceTest {
...
@@ -135,7 +135,7 @@ public class InstanceTest {
IllegalArgumentException
.
class
).
hasMessage
(
"'event' must refer the same instance"
);
IllegalArgumentException
.
class
).
hasMessage
(
"'event' must refer the same instance"
);
assertThatThrownBy
(()
->
instance
.
apply
(
new
InstanceDeregisteredEvent
(
InstanceId
.
of
(
"id"
),
1L
))).
isInstanceOf
(
assertThatThrownBy
(()
->
instance
.
apply
(
new
InstanceDeregisteredEvent
(
InstanceId
.
of
(
"id"
),
1L
))).
isInstanceOf
(
IllegalArgumentException
.
class
).
hasMessage
(
"
expected event version doesn't match
"
);
IllegalArgumentException
.
class
).
hasMessage
(
"
Event 1 doesn't match exptected version 0
"
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment