Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete symbol in exchange-core #140

Open
shanhashcah opened this issue Jun 26, 2023 · 8 comments
Open

Delete symbol in exchange-core #140

shanhashcah opened this issue Jun 26, 2023 · 8 comments

Comments

@shanhashcah
Copy link

shanhashcah commented Jun 26, 2023

Hi:

Is there any class to delete the existing symbol in exchange core. Actually here we have BatchAddSymbolsCommand class through we can add symbol dynamically but how to delete that symbol dynamically? I am search through the code but not getting something like. Pls help me.

Thanks

@shanhashcah
Copy link
Author

Hi @mzheravin

Pls give me some hints to get out of this issue.

Many Thanks

@esanchezros
Copy link

Not as far as I know but you can fork the code and add a new command to remove symbols

@shanhashcah
Copy link
Author

shanhashcah commented Jun 27, 2023

Hi @esanchezros

Thanks for your response. In BatchAddSymbolsCommand, we put the CoreSymbolSpecification object as value and symbolId as key in IntObjectHashMap . After that, SerializationUtils.marshallIntHashMap method which is serialize the IntObjectHashMap object.

So now If I try to create BatchDeleteSymbols command to delete the created symbol how would I get that object. I mean the key-pair which was stored in IntObjectHashMap. This is the issue.

Many Thanks

@shanhashcah
Copy link
Author

Hi @mzheravin Sir / @esanchezros Sir:

             Whatever I have figured out that symbol is stored as byte format through WriteBytesMarshallable. So how  to read that byte and get the symbol back.

Thanks

@shanhashcah
Copy link
Author

@mzheravin Sir ,
Pls help, so that I can add a new feature to the existing system. So we can delete the symbol dynamically.

@esanchezros
Copy link

Hey @shanhashcah,

Not sure if the repo is maintained any longer but adding this functionality yourself should not be difficult.

Have a look at

private void handleBinaryMessage(Object message) {
where the BatchAddSymbolsCommand is processed. You need to do something similar, adding a BatchDeleteSymbolsCommand which will delete the order book by symbolId

@shanhashcah
Copy link
Author

shanhashcah commented Aug 4, 2023

Hi @esanchezros Sir,

Thanks for your reply.


              I am trying to create a class like below, what I need to add inside writeMarshallable method . Is it correct or doing something wrong.

@AllArgsConstructor
@EqualsAndHashCode
@getter
public final class BatchDeleteSymbolsCommand implements BinaryDataCommand {

 private  IntObjectHashMap<Integer> symbols;

 public BatchDeleteSymbolsCommand(final int symbol) {
	 symbols = IntObjectHashMap.newWithKeysValues(symbol, symbol);
 }


@Override
public void writeMarshallable(BytesOut<?> bytes) throws IllegalStateException, BufferOverflowException,
		BufferUnderflowException, IllegalArgumentException, ArithmeticException {
	// TODO Auto-generated method stub
	
}

@Override
public int getBinaryCommandTypeCode() {
	// TODO Auto-generated method stub
	return BinaryCommandType.DELETE_SYMBOLS.getCode();
}

}

@esanchezros
Copy link

Not sure if you need to implement writeMarshallable, it may be the same as BatchAddSymbolsCommand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants