Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
warehouse-management
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Ascend
warehouse-management
Commits
350c2bc5
Commit
350c2bc5
authored
May 14, 2021
by
Shanelle Valencia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new proper topic names
parent
97c61015
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
11 deletions
+16
-11
orders_api_util.jsx
frontend/src/util/orders_api_util.jsx
+2
-2
session_api_util.jsx
frontend/src/util/session_api_util.jsx
+1
-1
KafkaConfig.java
.../com/ascendfinalproject/warehouse/config/KafkaConfig.java
+1
-1
Sender.java
...com/ascendfinalproject/warehouse/kafkaservice/Sender.java
+4
-4
Item.java
...in/java/com/ascendfinalproject/warehouse/models/Item.java
+2
-2
application.properties
src/main/resources/application.properties
+6
-1
No files found.
frontend/src/util/orders_api_util.jsx
View file @
350c2bc5
import
axios
from
'axios'
;
export
const
getOrders
=
()
=>
{
return
axios
.
get
(
`http://localhost:808
0
/api/orders`
);
return
axios
.
get
(
`http://localhost:808
1
/api/orders`
);
}
export
const
editOrder
=
(
order
)
=>
{
return
axios
.
put
(
`http://localhost:808
0
/api/orders/
${
order
.
id
}
`
,
order
)
return
axios
.
put
(
`http://localhost:808
1
/api/orders/
${
order
.
id
}
`
,
order
)
}
frontend/src/util/session_api_util.jsx
View file @
350c2bc5
...
...
@@ -2,6 +2,6 @@ import axios from "axios";
export
const
createSession
=
(
payload
)
=>
{
return
axios
.
post
(
"http://localhost:808
0
/api/auth"
,
payload
)
.
post
(
"http://localhost:808
1
/api/auth"
,
payload
)
.
catch
((
err
)
=>
err
.
response
);
};
src/main/java/com/ascendfinalproject/warehouse/config/KafkaConfig.java
View file @
350c2bc5
...
...
@@ -44,7 +44,7 @@ public class KafkaConfig {
}
@Bean
public
KafkaReceiver
<
String
,
String
>
kafkaEventReceiver
(
@Value
(
"
${kafka.topic.input}
"
)
String
topic
)
{
public
KafkaReceiver
<
String
,
String
>
kafkaEventReceiver
(
@Value
(
"
OMS_ORDER_UPDATE
"
)
String
topic
)
{
ReceiverOptions
<
String
,
String
>
receiverOptions
=
ReceiverOptions
.
create
(
consumerFactory
());
receiverOptions
.
maxCommitAttempts
(
5
);
return
KafkaReceiver
.
create
(
receiverOptions
.
addAssignListener
(
Collection:
:
iterator
).
subscription
(
Collections
.
singleton
(
topic
)));
...
...
src/main/java/com/ascendfinalproject/warehouse/kafkaservice/Sender.java
View file @
350c2bc5
...
...
@@ -23,12 +23,12 @@ public class Sender {
private
KafkaSender
<
String
,
WarehouseOrderResponse
>
kafkaUpdateEventProducer
;
private
static
final
String
TOPIC
=
"
warehouse_management
"
;
private
static
final
String
TOPIC
=
"
WMOS_ORDER_UPDATE
"
;
private
static
final
String
OMS
=
"
order_management
"
;
private
static
final
String
OMS
=
"
OMS_ORDER_UPDATE
"
;
public
void
sendOrder
(
WarehouseOrderRequest
currentOrder
)
{
ProducerRecord
<
String
,
WarehouseOrderRequest
>
record
=
new
ProducerRecord
<>(
OMS
,
currentOrder
);
ProducerRecord
<
String
,
WarehouseOrderRequest
>
record
=
new
ProducerRecord
<>(
TOPIC
,
currentOrder
);
Flux
<
SenderResult
<
WarehouseOrderRequest
>>
sendToKafka
=
kafkaOMSProducer
.
send
(
Mono
.
just
(
SenderRecord
.
create
(
record
,
currentOrder
)))
.
doOnError
(
throwable
->
System
.
out
.
println
(
throwable
))
.
doOnNext
(
t
->
{
...
...
@@ -40,7 +40,7 @@ public class Sender {
}
public
void
sendUpdatedOrder
(
WarehouseOrderResponse
currentOrder
)
{
ProducerRecord
<
String
,
WarehouseOrderResponse
>
record
=
new
ProducerRecord
<>(
TOPIC
,
currentOrder
);
ProducerRecord
<
String
,
WarehouseOrderResponse
>
record
=
new
ProducerRecord
<>(
OMS
,
currentOrder
);
Flux
<
SenderResult
<
WarehouseOrderResponse
>>
sendToKafka
=
kafkaUpdateEventProducer
.
send
(
Mono
.
just
(
SenderRecord
.
create
(
record
,
currentOrder
)))
.
doOnError
(
throwable
->
System
.
out
.
println
(
throwable
))
.
doOnNext
(
t
->
{
...
...
src/main/java/com/ascendfinalproject/warehouse/models/Item.java
View file @
350c2bc5
...
...
@@ -15,9 +15,9 @@ public class Item {
private
String
itemName
;
private
int
itemQuantity
;
private
double
itemPrice
;
private
int
itemSku
;
private
String
itemSku
;
public
Item
(
String
itemId
,
String
itemName
,
int
itemQuantity
,
double
itemPrice
,
int
itemSku
)
{
public
Item
(
String
itemId
,
String
itemName
,
int
itemQuantity
,
double
itemPrice
,
String
itemSku
)
{
this
.
itemId
=
itemId
;
this
.
itemName
=
itemName
;
this
.
itemQuantity
=
itemQuantity
;
...
...
src/main/resources/application.properties
View file @
350c2bc5
...
...
@@ -5,4 +5,9 @@ spring.data.mongodb.database=test
kafka.producer.bootstrap-servers
:
localhost:9092
kafka.producer.acks
:
all
kafka.consumer.group-id
:
WAREHOUSE_MANAGEMENT
kafka.topic.input
:
order_management
\ No newline at end of file
kafka.topic.input
:
WMOS_ORDER_UPDATE
#kafka.topic.input: OMS_ORDER_UPDATE
server.port
=
8081
\ No newline at end of file
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